错误现象 :

主要是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:\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 对应

卸载残留问题

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

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  node-sass@4.14

安装其他依赖:

npm install

启动项目:

npm run dev
GitHub 加速计划 / no / node-sass
8.5 K
1.33 K
下载
:rainbow: Node.js bindings to libsass
最近提交(Master分支:2 个月前 )
6081731a Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> 9 个月前
62c0f46c Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> 9 个月前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐