vue在install时node-sass@4.14.1?postinstall:node?scripts/build.js错误解决(@input vue)速看

随心笔谈2年前发布 编辑
174 0
🌐 经济型:买域名、轻量云服务器、用途:游戏 网站等 《腾讯云》特点:特价机便宜 适合初学者用 点我优惠购买
🚀 拓展型:买域名、轻量云服务器、用途:游戏 网站等 《阿里云》特点:中档服务器便宜 域名备案事多 点我优惠购买
🛡️ 稳定型:买域名、轻量云服务器、用途:游戏 网站等 《西部数码》 特点:比上两家略贵但是稳定性超好事也少 点我优惠购买



目录报错如下:解决方式1:解决方式2:总结

今天重装了node和Vue脚手架,在install的时候报了下面的错误

Build failed with error code: 1

[npminstall:runscript:error] node-sass@^4.14.1 run postinstall node scripts/build.js error: Error: Command failed with exit code 1: node scripts/build.js

at makeError (E:\node\node_global\node_modules\cnpm\node_modules\execa\lib\error.js:60:11)

at handlePromise (E:\node\node_global\node_modules\cnpm\node_modules\execa\index.js:118:26)

at runMicrotasks ()

at processTicksAndRejections (node:internal/process/task_queues:94:5)

at async Object.exports.runScript (E:\node\node_global\node_modules\cnpm\node_modules\npminstall\lib.js:262:12)

at async runLifecycleScripts (E:\node\node_global\node_modules\cnpm\node_modules\npminstall\lib\lifecycle_scripts.js:64:7)

at async _install (E:\node\node_global\node_modules\cnpm\node_modules\npminstall\lib\install_package.js:318:5)

at async install (E:\node\node_global\node_modules\cnpm\node_modules\npminstall\lib\install_package.js:23:12)

at async _installOne (E:\node\node_global\node_modules\cnpm\node_modules\npminstall\lib\local_install.js:214:15)

at async mapper (E:\node\node_global\node_modules\cnpm\node_modules\npminstall\lib\local_install.js:139:5) {

shortMessage: ‘Command failed with exit code 1: node scripts/build.js’,

command: ‘node scripts/build.js’,

escapedCommand: ‘node “scripts/build.js”’,

exitCode: 1,

signal: undefined,

signalDescription: undefined,

stdout: undefined,

stderr: undefined,

failed: true,

timedOut: false,

isCanceled: false,

killed: false

}

× Install fail! Error: run postinstall error, please remove node_modules before retry!

Command failed with exit code 1: node scripts/build.js

Error: Command failed with exit code 1: node scripts/build.js

at makeError (E:\node\node_global\node_modules\cnpm\node_modules\execa\lib\error.js:60:11)

at handlePromise (E:\node\node_global\node_modules\cnpm\node_modules\execa\index.js:118:26)

at processTicksAndRejections (node:internal/process/task_queues:94:5)

at async Object.exports.runScript (E:\node\node_global\node_modules\cnpm\node_modules\npminstall\lib.js:262:12)

at async runLifecycleScripts (E:\node\node_global\node_modules\cnpm\node_modules\npminstall\lib\lifecycle_scripts.js:64:7)

at async _install (E:\node\node_global\node_modules\cnpm\node_modules\npminstall\lib\install_package.js:318:5)

at async mapper (E:\node\node_global\node_modules\cnpm\node_modules\npminstall\lib\local_install.js:139:5)

npminstall version: 7.5.1

npminstall argv: E:\node\node.exe E:\node\node_global\node_modules\cnpm\node_modules\npminstall\bin\install.js –fix-bug-versions –china –userconfig=C:\Users\Administrator.cnpmrc –disturl=https://npmmirror.com/mirrors/node –registry=https://registry.npmmirror.com

请添加图片描述

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

虽然解决了这个问题,但是我打开页面不行。于是我可能知道是node版本太高的原因导致下载的sass源下载不下来,版本高很难下载版本低的东西。

重装node,我安装了node12就没问题了,这是最粗暴的解决方式

到此这篇关于vue在install时node-sass@4.14.1 postinstall:node scripts/build.js错误解决的文章就介绍到这了,更多相关vue install时node-sass@4.14.1内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!

您可能感兴趣的文章:vue npm install 安装某个指定的版本操作Vue安装依赖npm install时的报错问题及解决vue踩坑记之npm?install报错问题解决总结vue中install方法介绍Vue.use()的用法和install的用法解析

© 版权声明

相关文章