具体报错如下:
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\32008\AppData\Roaming\npm-cache\_logs\2021-05-30T08_34_40_264Z-debug.log
解决方案
1.安装cnpm
npm install -g cnpm -registry=https://registry.npm.taobao.org
安装成功可输入命令查看:
cnpm -v
C:\Users\32008>cnpm -v
cnpm@6.2.0 (C:\Users\32008\AppData\Roaming\npm\node_modules\cnpm\lib\parse_argv.js)
npm@6.14.13 (C:\Users\32008\AppData\Roaming\npm\node_modules\cnpm\node_modules\npm\lib\npm.js)
node@14.15.4 (E:\前端\node\node.exe)
npminstall@3.28.0 (C:\Users\32008\AppData\Roaming\npm\node_modules\cnpm\node_modules\npminstall\lib\index.js)
prefix=C:\Users\32008\AppData\Roaming\npm
win32 x64 10.0.19042
registry=https://registry.nlark.com
2.卸载node-sass:
npm uninstall node-sass
E:\java\Git\renren-fast-vue>npm uninstall node-sass
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN rm not removing E:\java\Git\renren-fast-vue\node_modules\.bin\jest.ps1 as it wasn't installed by E:\java\Git\renren-fast-vue\node_modules\jest-cli
npm WARN rm not removing E:\java\Git\renren-fast-vue\node_modules\.bin\jest.cmd as it wasn't installed by E:\java\Git\renren-fast-vue\node_modules\jest-cli
npm WARN rm not removing E:\java\Git\renren-fast-vue\node_modules\.bin\jest as it wasn't installed by E:\java\Git\renren-fast-vue\node_modules\jest-cli
npm WARN rm not removing E:\java\Git\renren-fast-vue\node_modules\.bin\gulp.ps1 as it wasn't installed by E:\java\Git\renren-fast-vue\node_modules\gulp-cli
npm WARN rm not removing E:\java\Git\renren-fast-vue\node_modules\.bin\gulp.cmd as it wasn't installed by E:\java\Git\renren-fast-vue\node_modules\gulp-cli
npm WARN rm not removing E:\java\Git\renren-fast-vue\node_modules\.bin\gulp as it wasn't installed by E:\java\Git\renren-fast-vue\node_modules\gulp-cli
npm WARN rm not removing E:\java\Git\renren-fast-vue\node_modules\.bin\shjs.ps1 as it wasn't installed by E:\java\Git\renren-fast-vue\node_modules\_shelljs@0.7.8@shelljs
npm WARN rm not removing E:\java\Git\renren-fast-vue\node_modules\.bin\shjs.cmd as it wasn't installed by E:\java\Git\renren-fast-vue\node_modules\_shelljs@0.7.8@shelljs
npm WARN rm not removing E:\java\Git\renren-fast-vue\node_modules\.bin\shjs as it wasn't installed by E:\java\Git\renren-fast-vue\node_modules\_shelljs@0.7.8@shelljs
npm WARN rm not removing E:\java\Git\renren-fast-vue\node_modules\.bin\semver.ps1 as it wasn't installed by E:\java\Git\renren-fast-vue\node_modules\_semver@5.7.1@semver
npm WARN rm not removing E:\java\Git\renren-fast-vue\node_modules\.bin\semver.cmd as it wasn't installed by E:\java\Git\renren-fast-vue\node_modules\_semver@5.7.1@semver
npm WARN rm not removing E:\java\Git\renren-fast-vue\node_modules\.bin\semver as it wasn't installed by E:\java\Git\renren-fast-vue\node_modules\_semver@5.7.1@semver
npm WARN rm not removing E:\java\Git\renren-fast-vue\node_modules\.bin\rimraf.ps1 as it wasn't installed by E:\java\Git\renren-fast-vue\node_modules\_rimraf@2.7.1@rimraf
npm WARN rm not removing E:\java\Git\renren-fast-vue\node_modules\.bin\rimraf.cmd as it wasn't installed by E:\java\Git\renren-fast-vue\node_modules\_rimraf@2.7.1@rimraf
npm WARN rm not removing E:\java\Git\renren-fast-vue\node_modules\.bin\rimraf as it wasn't installed by E:\java\Git\renren-fast-vue\node_modules\_rimraf@2.7.1@rimraf
npm WARN rm not removing E:\java\Git\renren-fast-vue\node_modules\.bin\rimraf.ps1 as it wasn't installed by E:\java\Git\renren-fast-vue\node_modules\_rimraf@2.6.3@rimraf
npm WARN rm not removing E:\java\Git\renren-fast-vue\node_modules\.bin\rimraf.cmd as it wasn't installed by E:\java\Git\renren-fast-vue\node_modules\_rimraf@2.6.3@rimraf
npm WARN rm not removing E:\java\Git\renren-fast-vue\node_modules\.bin\rimraf as it wasn't installed by E:\java\Git\renren-fast-vue\node_modules\_rimraf@2.6.3@rimraf
3.重新安装node-sass:cnpm install node-sass
E:\java\Git\renren-fast-vue>cnpm install node-sass
√ Installed 1 packages
√ Linked 176 latest versions
[1/1] scripts.install node-sass@* run "node scripts/install.js", root: "E:\\java\\Git\\renren-fast-vue\\node_modules\\_node-sass@6.0.0@node-sass"
Cached binary found at C:\Users\32008\.npminstall_tarball\node-sass\6.0.0\win32-x64-83_binding.node
[1/1] scripts.install node-sass@* finished in 442ms
[1/1] scripts.postinstall node-sass@* run "node scripts/build.js", root: "E:\\java\\Git\\renren-fast-vue\\node_modules\\_node-sass@6.0.0@node-sass"
Binary found at E:\java\Git\renren-fast-vue\node_modules\_node-sass@6.0.0@node-sass\vendor\win32-x64-83\binding.node
Testing binary
Binary is fine
[1/1] scripts.postinstall node-sass@* finished in 161ms
√ Run 1 scripts
deprecate node-sass@6.0.0 › request@^2.88.0 request has been deprecated, see https://github.com/request/request/issues/3142
deprecate node-sass@6.0.0 › request@2.88.2 › har-validator@~5.1.3 this library is no longer supported
Recently updated (since 2021-05-23): 1 packages (detail see file E:\java\Git\renren-fast-vue\node_modules\.recently_updates.txt)
√ All packages installed (192 packages installed from npm registry, used 6s(network 5s), speed 72.53kB/s, json 177(365.18kB), tarball 0B)
版权声明:本文为qq_46237746原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。