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版本太高的原因?qū)е孪螺d的sass源下載不下來,版本高很難下載版本低的東西。
解決方式2:
重裝node,我安裝了node12就沒問題了,這是最粗暴的解決方式
總結(jié)
到此這篇關(guān)于vue在install時node-sass@4.14.1 postinstall:node scripts/build.js錯誤解決的文章就介紹到這了,更多相關(guān)vue install時node-sass@4.14.1內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
VUE2 前端實現(xiàn) 靜態(tài)二級省市聯(lián)動選擇select的示例
下面小編就為大家分享一篇VUE2 前端實現(xiàn) 靜態(tài)二級省市聯(lián)動選擇select的示例。具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2018-02-02
vue3.0 proxy設(shè)置代理不成功的問題及解決方案
這篇文章主要介紹了vue3.0 proxy設(shè)置代理不成功的問題及解決方案,本文給大家介紹的非常詳細,對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友參考下吧2023-12-12
Vue3報錯‘defineProps‘?is?not?defined的解決方法
最近工作中遇到vue3中使用defineProps中報錯,飄紅,所以這篇文章主要給大家介紹了關(guān)于Vue3報錯‘defineProps‘?is?not?defined的解決方法,需要的朋友可以參考下2023-01-01
VUE動態(tài)綁定class類的三種常用方式及適用場景詳解
文章介紹了在實際開發(fā)中動態(tài)綁定class的三種常見情況及其解決方案,包括根據(jù)不同的返回值渲染不同的class樣式、給模塊添加基礎(chǔ)樣式以及根據(jù)設(shè)計確定是否使用多個樣式2025-01-01
基于VUE實現(xiàn)判斷設(shè)備是PC還是移動端
這篇文章主要介紹了基于VUE實現(xiàn)判斷設(shè)備是PC還是移動端,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友可以參考下2020-07-07
Vue 列表頁帶參數(shù)進詳情頁的操作(router-link)
這篇文章主要介紹了Vue 列表頁帶參數(shù)進詳情頁的操作(router-link),具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2020-11-11
vue項目使用luckyexcel預(yù)覽excel表格功能(心路歷程)
這篇文章主要介紹了vue項目使用luckyexcel預(yù)覽excel表格,我總共嘗試了2種方法預(yù)覽excel,均可實現(xiàn),還發(fā)現(xiàn)一種方法可以實現(xiàn),需要后端配合,叫做KKfileview,本文給大家介紹的非常詳細,需要的朋友可以參考下2023-10-10
使用vue2.6實現(xiàn)抖音【時間輪盤】屏保效果附源碼
前段時間看抖音,有人用時間輪盤作為動態(tài)的桌面壁紙,一時間成為全網(wǎng)最火的電腦屏保,后來小米等運用市場也出現(xiàn)了【時間輪盤】,有點像五行八卦,感覺很好玩,于是突發(fā)奇想,自己寫一個網(wǎng)頁版小DEMO玩玩,需要的朋友可以參考下2019-04-04


