node-sass sass-loader vue空项目都安不上这俩

E:\Code\Vue\flight-vue>npm install node-sass sass-loader --save-dev
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: flight-vue@1.0.0
npm ERR! Found: webpack@3.12.0
npm ERR! node_modules/webpack
npm ERR!   dev webpack@"^3.6.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer webpack@"^5.0.0" from sass-loader@13.0.2
npm ERR! node_modules/sass-loader
npm ERR!   dev sass-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 E:\nodejs-repository\cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR!     E:\nodejs-repository\cache\_logs\2022-07-06T08_19_27_001Z-debug-0.log

看样子是版本冲突导致的,但是我这个项目是空项目,通过下面命令安装的

vue init webpack flight-vue

回答

用vite构建项目,就不会有这两个包问题,安装sass的时候就只用执行 npm install sass (不再去安装那两个包)
而且vite编译起来更快,谁用谁知道。
PS:这两个包问题已经劝退很多人了.....(非常难用)

以上是node-sass sass-loader vue空项目都安不上这俩的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>