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

Posted 秋9

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vue中node-sass下载失败Failed at the node-sass@7.0.1 postinstall script.解决方法相关的知识,希望对你有一定的参考价值。

【现象】

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

以上是关于vue中node-sass下载失败Failed at the node-sass@7.0.1 postinstall script.解决方法的主要内容,如果未能解决你的问题,请参考以下文章

启动vue项目失败,报错Failed at the node-sass@4.14.1 postinstall script.

node-sass安装失败,并且报错Module build failed (from ./node_modules/sass-loader/lib/loader.js)

nexus raw 仓库代理(node-sass离线安装node-sass: Command failed)

nexus raw 仓库代理(node-sass离线安装node-sass: Command failed)

nexus raw 仓库代理(node-sass离线安装node-sass: Command failed)

node-sass安装失败之npm ERR! Failed at the node-sass@4.12.0 postinstall script.