Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

项目运行报错 #49

Open
liyicheng94 opened this issue Jan 10, 2022 · 5 comments
Open

项目运行报错 #49

liyicheng94 opened this issue Jan 10, 2022 · 5 comments

Comments

@liyicheng94
Copy link

npm i之后serve报错运行不了

@wdlhao
Copy link
Owner

wdlhao commented Oct 17, 2022

什么报错?

@ping65588
Copy link

我也是遇到这个问题。具体报错信息如下:

PS C:\Users\ping\Desktop\demo\vue2-element-touzi-admin> npm i
npm WARN config global --global, --local are deprecated. Use --location=global instead.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: css-loader@6.7.1
npm ERR! Found: webpack@4.46.0
npm ERR! node_modules/webpack
npm ERR! peer webpack@"^4.0.0 || ^5.0.0" from @soda/friendly-errors-webpack-plugin@1.8.1
npm ERR! node_modules/@soda/friendly-errors-webpack-plugin
npm ERR! @soda/friendly-errors-webpack-plugin@"^1.8.0" from @vue/cli-service@5.0.8
npm ERR! node_modules/@vue/cli-service
npm ERR! dev @vue/cli-service@"^5.0.8" from the root project
npm ERR! 2 more (@vue/cli-plugin-router, @vue/cli-plugin-vuex)
npm ERR! webpack@"^4.0.0" from @vue/cli-plugin-babel@3.12.1
npm ERR! node_modules/@vue/cli-plugin-babel
npm ERR! dev @vue/cli-plugin-babel@"^3.11.0" from the root project
npm ERR! 12 more (@vue/cli-plugin-eslint, @vue/vue-loader-v15, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer webpack@"^5.0.0" from css-loader@6.7.1
npm ERR! node_modules/css-loader
npm ERR! css-loader@"^6.5.0" from @vue/cli-service@5.0.8
npm ERR! node_modules/@vue/cli-service
npm ERR! dev @vue/cli-service@"^5.0.8" from the root project
npm ERR! 2 more (@vue/cli-plugin-router, @vue/cli-plugin-vuex)
npm ERR! peer css-loader@"" from @vue/vue-loader-v15@15.10.0
npm ERR! node_modules/@vue/vue-loader-v15
npm ERR! @vue/vue-loader-v15@"npm:vue-loader@^15.9.7" from @vue/cli-service@5.0.8
npm ERR! dev @vue/cli-service@"^5.0.8" from the root project
npm ERR! 2 more (@vue/cli-plugin-router, @vue/cli-plugin-vuex)
npm ERR! 1 more (vue-loader)
npm ERR!
npm ERR! Conflicting peer dependency: webpack@5.74.0
npm ERR! node_modules/webpack
npm ERR! peer webpack@"^5.0.0" from css-loader@6.7.1
npm ERR! node_modules/css-loader
npm ERR! css-loader@"^6.5.0" from @vue/cli-service@5.0.8
npm ERR! node_modules/@vue/cli-service
npm ERR! dev @vue/cli-service@"^5.0.8" from the root project
npm ERR! 2 more (@vue/cli-plugin-router, @vue/cli-plugin-vuex)
npm ERR! peer css-loader@"
" from @vue/vue-loader-v15@15.10.0
npm ERR! node_modules/@vue/vue-loader-v15
npm ERR! @vue/vue-loader-v15@"npm:vue-loader@^15.9.7" from @vue/cli-service@5.0.8
npm ERR! node_modules/@vue/cli-service
npm ERR! dev @vue/cli-service@"^5.0.8" from the root project
npm ERR! 2 more (@vue/cli-plugin-router, @vue/cli-plugin-vuex)
npm ERR! 1 more (vue-loader)
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\ping\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\ping\AppData\Local\npm-cache_logs\2022-10-22T11_09_48_908Z-debug-0.log

@Jing0507
Copy link

我也是遇到这个问题。具体报错信息如下:

PS C:\Users\ping\Desktop\demo\vue2-element-touzi-admin> npm i npm WARN config global --global--local已弃用。改为使用--location=global。 npm 错误!代码 ERESOLVE npm 错误!ERESOLVE 无法解析 npm ERR! npm 错误!解决时:css-loader@6.7.1 npm ERR!发现:webpack@4.46.0 npm 错误!node_modules/webpack npm 错误!peer webpack@"^4.0.0 || ^5.0.0" 来自@soda/friendly-errors-webpack-plugin@1.8.1 npm ERR!node_modules/@soda/friendly-errors-webpack-plugin npm ERR!@soda/friendly-errors-webpack-plugin@"^1.8.0" 来自 @vue/cli-service@5.0.8 npm 错误!node_modules/@vue/cli-service npm 错误!来自根项目的 dev @vue/cli-service@"^5.0.8" npm 错误!还有 2 个(@vue/cli-plugin-router、@vue/cli-plugin-vuex) npm 错误!webpack@"^4.0.0" 来自@vue/cli-plugin-babel@3.12.1 npm ERR!node_modules/@vue/cli-plugin-babel npm 错误!dev @vue/cli-plugin-babel@"^3.11.0" 来自根项目 npm ERR!还有 12 个 (@vue/cli-plugin-eslint, @vue/vue-loader-v15, ...) npm ERR! npm 错误!无法解决依赖关系: npm ERR!对等 webpack@"^5.0.0" 来自 css-loader@6.7.1 npm ERR!node_modules/css-loader npm 错误!css-loader@"^6.5.0" 来自@vue/cli-service@5.0.8 npm 错误!node_modules/@vue/cli-service npm 错误!dev @vue/cli-service@"^5.0.8" 来自根项目 npm ERR!还有 2 个(@vue/cli-plugin-router, npm 错误!对等 css-loader@" " 来自 @vue/vue-loader-v15@15.10.0 npm ERR!node_modules/@vue/vue-loader-v15 npm 错误!@vue/vue-loader-v15@"npm:vue-loader@^15.9.7" 来自@vue/cli-service@5.0.8 npm 错误!dev @vue/cli-service@"^5.0.8" 来自根项目 npm ERR!还有 2 个(@vue/cli-plugin-router、@vue/cli-plugin-vuex) npm 错误!还有 1 个 (vue-loader) npm ERR! npm 错误!冲突的对等依赖关系:webpack@5.74.0 npm ERR!node_modules/webpack npm 错误!对等 webpack@"^5.0.0" 来自 css-loader@6.7.1 npm ERR!node_modules/css-loader npm 错误!css-loader@"^6.5.0" 来自@vue/cli-service@5.0.8 npm 错误!node_modules/@vue/cli-service npm 错误!dev @vue/cli-service@"^5.0.8" 来自根项目 npm ERR!还有 2 个(@vue/cli-plugin-router、@vue/cli-plugin-vuex) npm 错误!对等 css-loader@" " 来自 @vue/vue-loader-v15@15.10.0 npm ERR!node_modules/@vue/vue-loader-v15 npm 错误!@vue/vue-loader-v15@"npm:vue-loader@^15.9.7" 来自@vue/cli-service@5.0.8 npm 错误!node_modules/@vue/cli-service npm 错误!dev @vue/cli-service@"^5.0.8" 来自根项目 npm ERR!还有 2 个(@vue/cli-plugin-router、@vue/cli-plugin-vuex) npm 错误!还有 1 个 (vue-loader) npm ERR! npm 错误!修复上游依赖冲突,或者重试 npm ERR!这个命令带有--force, npm 错误!接受不正确的(并且可能被破坏的)依赖解决方案。 npm 错误! npm 错误!有关完整报告,请参阅 C:\Users\ping\AppData\Local\npm-cache\eresolve-report.txt。

npm 错误!可以在以下位置找到此运行的完整日志: npm ERR!C:\Users\ping\AppData\Local\npm-cache_logs\2022-10-22T11_09_48_908Z-debug-0.log

解决了吗 我也这样

@ping65588
Copy link

ping65588 commented Oct 27, 2022 via email

@wdlhao
Copy link
Owner

wdlhao commented Nov 4, 2022

执行npm run dev报错处理方案:
1、重新拉取最新代码,删除本地node_modules;
2、可能是你的本机安装nodejs版本过高,请卸载nodejs高版本,重新安装较低版本(如v10.9.0);
或者通过安装nvm来切换到较低版本也可以实现正常启动;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants