npm install node-sass 报错问题的解决方案
npm install node-sass报错问题的解决
错误现象 :
主要是node-sass版本问题,他的版本看和node版本对应
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.13.1 postinstall:node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:UserscpucodeAppDataRoamingnpm-cache_logs2021-06-10T13_48_01_433Z-debug.log
解决方案 :
查看对于版本信息
https://hub.fastgit.org/sass/node-sass
都可以看到node和node-sass对应的版本信息
查看版本
node -v
与 4.14 对应
卸载残留问题
先清依赖残留,否则安装不上
npm rebuild node-sass
npm uninstall node-sass
类似于这种错误不用管
14 packages are looking for funding
runnpm fund
for details
found 3828 vulnerabilities (1726 low, 211 moderate, 1889 high, 2 critical)
runnpm audit fix
to fix them, ornpm audit
for details
安装 4.14的
npm install node-sass@4.14
安装其他依赖:
npm install
启动项目:
npm run dev
标签:
相关文章
-
无相关信息