报错:

× Install fail! RunScriptError: post install error, please remove node_modules b

efore retry!

Run "C:\Windows\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build" error, exit code 1

RunScriptError: Run "C:\Windows\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build" error, exit code 1

    at ChildProcess.<anonymous> (C:\Users\地址\AppData\Roaming\npm\node_modules\cnpm\node_modules\runscript\index.js:96:21)

    at ChildProcess.emit (events.js:196:13)

    at maybeClose (internal/child_process.js:1011:16)

    at Process.ChildProcess._handle.onexit (internal/child_process.js:268:5)

npminstall version: 3.27.0

npminstall args: C:\Program Files\nodejs\node.exe C:\Users\地址\AppData\Roaming\npm\node_modules\cnpm\node_modules\npminstall\bin\install.js --fix-bug-versions --china --userconfig=C:\Users\地址\.cnpmrc --disturl=https://npm.taobao.org/mirrors/node --registry=https://r.npm.taobao.org

在这里插入图片描述

定位问题:
从git上面拉取的代码,在另外的电脑环境可以正常的安装依赖,只是node版本不同,基本上确定是node版本的问题

解决方法:
重新构建包

npm rebuild node-sass

安装完重启即可。
因为node版本出现的问题,可以统一一下项目的node版本,或者利用nvm管理安装多个node版本可供切换使用,推荐使用后者。

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐