啟動vue項目失敗,報錯Failed at the node-sass@4.14.1 postinstall script.


在啟動vue項目的時候報錯

報錯信息如下:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.14.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.14.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

找不到sass,查看node-sass文件,里面沒有文件。

所以在npm install前設置sass源。

解決方案:直接在當前目錄下進行node-sass 的數據源設置

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

安裝依賴:

# 建議不要直接使用 cnpm 安裝依賴,會有各種詭異的 bug。可以通過如下操作解決 npm 下載速度慢的問題

npm install --registry=https://registry.npm.taobao.org

# 啟動服務

npm run dev

 
安裝依賴:
# 建議不要直接使用 cnpm 安裝依賴,會有各種詭異的 bug。可以通過如下操作解決 npm 下載速度慢的問題 npm install --registry=https://registry.npm.taobao.org


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM