最近在npminstall的时候遇到了个问题,所以给大家总结下,下面这篇文章主要给大家介绍了关于vue在install时node-sass@4.14.1 postinstall:node scripts/build.js错误的解决方法,需要的朋友可以参考下
今天重装了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\utils.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\utils.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
解决方式1:
npm config set sass_binary_site=https://npm.taobao.org/mirrors/node-sass
npm install
虽然解决了这个问题,但是我打开页面不行。于是我可能知道是node版本太高的原因导致下载的sass源下载不下来,版本高很难下载版本低的东西。
解决方式2:
重装node,我安装了node12就没问题了,这是最粗暴的解决方式
总结
到此这篇关于vue在install时node-sass@4.14.1 postinstall:node scripts/build.js错误解决的文章就介绍到这了,更多相关vue install时node-sass@4.14.1内容请搜索编程学习网以前的文章希望大家以后多多支持编程学习网!
本文标题为:vue在install时node-sass@4.14.1 postinstall:node scripts/build.js错误解决
基础教程推荐
- ExtJS 3.x DateField menuListeners 显示/隐藏 2022-09-15
- vue的 Mixins (混入) 2023-10-08
- ECSHOP中实现ajax弹窗登录功能 2023-01-31
- 关于 css:WebKit (iPad) CSS3: 背景过渡闪烁 2022-09-21
- Vue+WebSocket实现在线聊天 2023-10-08
- 基于bootstrap的上传插件fileinput实现ajax异步上传功能(支持多文件上传预览拖拽) 2023-02-01
- 深入浅析Jsonp解决ajax跨域问题 2022-12-28
- 解决ajax的delete、put方法接收不到参数的问题方法 2023-02-23
- 分页技术原理与实现之无刷新的Ajax分页技术(三) 2023-01-20
- 第7天:CSS入门 2022-11-04