vue中node-sass下载失败Failed at the node-sass@7.0.1 postinstall script.解决方法

x33g5p2x  于2022-06-29 转载在 其他  
字(0.7k)|赞(0)|评价(0)|浏览(673)

【现象】

npm WARN The package connect is included as both a dev and production dependency.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@7.0.1 postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@7.0.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\86183\AppData\Roaming\npm-cache_logs\2022-06-28T08_23_00_917Z-debug.log

【解决方法】

可通过配置淘宝的镜像源解决,首先配置淘宝的镜像源

npm config set registry https://registry.npm.taobao.org

然后在 ~/.npmrc 加入下面内容

sass_binary_site=https://npm.taobao.org/mirrors/node-sass/

.npmrc 文件位于

win:C:\Users\[你的账户名称]\.npmrc
linux:直接使用 vi ~/.npmrc

相关文章