npm 打包异常-node-sass异常

在接手一个工程时,遇到了npm install阶段node-sass版本不兼容的问题,通过切换到node10版本解决了此问题。另外,尽管fsevents警告在Windows上无关紧要,但当npm run build失败时,可能需要手动删除npm-shrinkwrap.json中相关依赖。最终,gyp build error和npm ERR!导致了安装失败,提示重新检查依赖和环境配置。
摘要由CSDN通过智能技术生成

一、接别人的工程,npm install遇到个坑,仔细分析异常node-sass,其实是版本问题,node-sass和node有对应版本。最后换成node10 解决。

二、fsevents 警告意思是windows不需要。这个不用管,但如果npm run build 报错,那么手动删掉npm-shrinkwrap.json里的相关依赖吧。

已用时间 00:04:06.29
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (D:\发布\1\project\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:203:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Windows_NT 10.0.19043
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\发布\\1\\project\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd D:\发布\1\project\node_modules\node-sass
gyp ERR! node -v v12.8.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.3 (node_modules\ember-cli-broccoli-sane-watcher\node_modules\sane\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.9.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.9.0 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\issuser\AppData\Roaming\npm-cache\_logs\2022-04-15T09_44_07_364Z-debug.log

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值