npm install node-sass 报错问题的解决方案

错误现象 :

主要是node-sass版本问题,他的版本看和node版本对应

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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:\Users\cpucode\AppData\Roaming\npm-cache_logs\2021-06-10T13_48_01_433Z-debug.log

在这里插入图片描述

解决方案 :

查看对于版本信息

https://hub.fastgit.org/sass/node-sass

都可以看到node和node-sass对应的版本信息

在这里插入图片描述

查看版本

node -v

在这里插入图片描述
与 4.14 对应

扫描二维码关注公众号,回复: 13228195 查看本文章

卸载残留问题

先清依赖残留,否则安装不上

npm rebuild node-sass
npm uninstall node-sass

类似于这种错误不用管

14 packages are looking for funding
run npm fund for details
found 3828 vulnerabilities (1726 low, 211 moderate, 1889 high, 2 critical)
run npm audit fix to fix them, or npm audit for details

在这里插入图片描述

安装 4.14的

npm install  [email protected]

安装其他依赖:

npm install

启动项目:

npm run dev

猜你喜欢

转载自blog.csdn.net/qq_44226094/article/details/117792206