node和sass版本不匹配
我现在的node版本是16.15.1,对应的node-
sass
版本就是6.0多(“node-sass”: “^6.0.1”,),
直接在package.json上修改,npm i 安装 如果出现以下情况
RESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: elm@2.0.1
npm ERR! Found: node-sass@6.0.1
npm ERR! node_modules/node-sass
npm ERR! dev node-sass@“^6.0.1” from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer node-sass@“^3.4.2 || ^4.0.0” from sass-loader@4.1.1
npm ERR! node_modules/sass-loader
npm ERR! dev sass-loader@“^4.1.1” from the root project
npm ERR!
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 D:\Program Files\nodejs\node_cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
指令后面加上 --legacy-peer-deps
npm i --legacy-peer-deps
如果不行
npm install 第一次报错后,再运行
npm install node-sass@npm:sass --ignore-scripts
完了之后npm install然后直接npm run dev