首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在VueCLI3项目中安装较少的加载器

无法在VueCLI3项目中安装较少的加载器
EN

Stack Overflow用户
提问于 2021-06-13 20:36:47
回答 1查看 80关注 0票数 0

我的项目的一些页面使用less来渲染,所以我运行npm命令来安装less和less-loader,但发现just less可以成功安装,由于未知的原因,less-loader保持安装失败并抛出错误,如下所示:

代码语言:javascript
复制
PS E:\myprogramming\tutorial\frontEND\eduResourceCode\Vue教程\复习\Vue脚手架CLI3\vuexdemo_> npm i less-loader
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: webpack@4.46.0
npm ERR! node_modules/webpack
npm ERR!   peer webpack@"^4.0.0" from @intervolga/optimize-cssnano-plugin@1.0.6
npm ERR!   node_modules/@intervolga/optimize-cssnano-plugin
npm ERR!     @intervolga/optimize-cssnano-plugin@"^1.0.5" from @vue/cli-service@4.5.13
npm ERR!     node_modules/@vue/cli-service
npm ERR!       peer @vue/cli-service@"^3.0.0 || ^4.0.0-0" from @vue/cli-plugin-babel@4.5.13
npm ERR!       node_modules/@vue/cli-plugin-babel
npm ERR!         dev @vue/cli-plugin-babel@"~4.5.0" from the root project
npm ERR!       4 more (@vue/cli-plugin-eslint, @vue/cli-plugin-router, ...)
npm ERR!   peer webpack@"^4.0.0 || ^5.0.0" from @soda/friendly-errors-webpack-plugin@1.8.0
npm ERR!   node_modules/@soda/friendly-errors-webpack-plugin
npm ERR!     @soda/friendly-errors-webpack-plugin@"^1.7.1" from @vue/cli-service@4.5.13
npm ERR!     node_modules/@vue/cli-service
npm ERR!       peer @vue/cli-service@"^3.0.0 || ^4.0.0-0" from @vue/cli-plugin-babel@4.5.13
npm ERR!       node_modules/@vue/cli-plugin-babel
npm ERR!         dev @vue/cli-plugin-babel@"~4.5.0" from the root project
npm ERR!       4 more (@vue/cli-plugin-eslint, @vue/cli-plugin-router, ...)
npm ERR!   18 more (@vue/cli-plugin-babel, @vue/cli-plugin-eslint, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! less-loader@"*" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: webpack@5.38.1
npm ERR! node_modules/webpack
npm ERR!   peer webpack@"^5.0.0" from less-loader@9.1.0
npm ERR!   node_modules/less-loader
npm ERR!     less-loader@"*" from the root project
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\hw\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\hw\AppData\Local\npm-cache\_logs\2021-06-13T12_28_33_753Z-debug.log

但是我的开发服务器没有less-loader就无法运行,我尝试了很多方法,比如重新安装两个依赖项,使用vue-cil下载同名插件,或者将其他less-loader标签粘贴到我的package.json上,但都不起作用。

我发现一个可能的,但奇怪的原因是我的node_modules没有一个更少加载程序的文件夹!现在我该如何修复它呢?

EN

回答 1

Stack Overflow用户

发布于 2021-06-13 22:26:54

我通过使用css-prodecessor合并我的项目,它解决了我仍然困惑的problem.but。我不喜欢通过合并来解决问题,因为它会破坏一些我已经完成的文件。如果我能有更少的加载器后,我的项目,这将是更好的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67958335

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档