您现在的位置是:网站首页 > 代码编程 > WEB前端WEB前端

【原】对开源项目eladmin进行npm install因为版本不匹配导致失败

不忘初心 不忘初心 2021-11-05 围观() 评论() 点赞() WEB前端

简介:最近要做一个新的后台管理项目,在网上溜达了一圈,看中了eladmin这个开源项目,可是在进行npm install的时候直接就失败了,看起来似乎是因为babel的缘故,但错误信息看的也不是很清晰,没办法第一时间确定下来,只能慢慢调试。

最近要做一个新的后台管理项目,在网上溜达了一圈,看中了eladmin这个开源项目,可是在进行npm install的时候直接就失败了,看起来似乎是因为babel的缘故,但错误信息看的也不是很清晰,没办法第一时间确定下来,只能慢慢调试。

对开源项目eladmin进行npm install因为版本不匹配导致失败

详细错误信息如下:

PS D:\workspace_ued\eladmin-web> npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: @babel/core@7.0.0
npm ERR! node_modules/@babel/core
npm ERR! dev @babel/core@"7.0.0" from the root project
npm ERR! peer @babel/core@"^7.0.0-0" from @babel/register@7.0.0
npm ERR! node_modules/@babel/register
npm ERR! dev @babel/register@"7.0.0" from the root project
npm ERR! 61 more (@vue/babel-plugin-transform-vue-jsx, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @babel/core@"^7.4.0-0" from @babel/helper-define-polyfill-provider@0.2.4
npm ERR! node_modules/babel-plugin-polyfill-corejs2/node_modules/@babel/helper-define-polyfill-provider
npm ERR! @babel/helper-define-polyfill-provider@"^0.2.4" from babel-plugin-polyfill-corejs2@0.2.3
npm ERR! node_modules/babel-plugin-polyfill-corejs2
npm ERR! babel-plugin-polyfill-corejs2@"^0.2.3" from @babel/plugin-transform-runtime@7.16.0
npm ERR! node_modules/@babel/plugin-transform-runtime
npm ERR! @babel/plugin-transform-runtime@"^7.4.0" from @vue/babel-preset-app@3.12.1
npm ERR! node_modules/@vue/babel-preset-app
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\Administrator.LAPTOP-9J4HVAON\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator.LAPTOP-9J4HVAON\AppData\Local\npm-cache\_logs\2021-11-04T03_52_28_810Z-debug.log

package.json代码如下:

"devDependencies": {
"@babel/core": "7.0.0",
"@babel/parser": "^7.7.4",
"@babel/register": "7.0.0",
"@vue/babel-plugin-transform-vue-jsx": "^1.2.1",
"@vue/cli-plugin-babel": "3.5.3",
"@vue/cli-plugin-eslint": "^3.9.1",
"@vue/cli-plugin-unit-jest": "3.5.3",
"@vue/cli-service": "3.5.3",
"@vue/test-utils": "1.0.0-beta.29",
"autoprefixer": "^9.5.1",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "10.0.1",
"babel-jest": "23.6.0",
"babel-plugin-dynamic-import-node": "2.3.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"chalk": "2.4.2",
"chokidar": "2.1.5",
"connect": "3.6.6",
"eslint": "5.15.3",
"eslint-plugin-vue": "5.2.2",
"html-webpack-plugin": "3.2.0",
"http-proxy-middleware": "^0.19.1",
"husky": "1.3.1",
"lint-staged": "8.1.5",
"plop": "2.3.0",
"runjs": "^4.3.2",
"sass": "^1.26.10",
"sass-loader": "^7.1.0",
"script-ext-html-webpack-plugin": "2.1.3",
"script-loader": "0.7.2",
"serve-static": "^1.13.2",
"svg-sprite-loader": "4.1.3",
"svgo": "1.2.0",
"vue-template-compiler": "2.6.10"
}

查阅资料之后,找到了3种解决方案:

1、将npm更改为6.14.10版本;

2、使用yarn install来安装modules;

3、将@babel/core更改为7.4.0版本;

npmnodevue

看完文章,有任何疑问,请加入群聊一起交流!!!

很赞哦! ()

文章评论

  • 请先说点什么
    人参与,条评论

请使用电脑浏览器访问本页面,使用手机浏览器访问本页面会导致下载文件异常!!!

雨落无影

关注上方公众号,回复关键字【下载】获取下载码

用完即删,每次下载需重新获取下载码

若出现下载不了的情况,请及时联系站长进行解决

站点信息

  • 网站程序:spring + freemarker
  • 主题模板:《今夕何夕》
  • 文章统计:篇文章
  • 标签管理标签云
  • 微信公众号:扫描二维码,关注我们