node-sass 安裝失敗 Failed at the node-sass@4.9.2 postinstall script的解決


控制台運行npm install時報錯,報錯信息如下:


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



解決方法:

1、卸載node-sass

運行:npm uninstall node-sass


2、重新安裝指定的node-sass版本(安裝失敗的版本)

運行:npm install node-sass@4.9.3


3、如果還是安裝不成功的話,或者安裝太慢連接不上,使用一下淘寶鏡像后重復1,2步驟,成功后再npm install

使用淘寶鏡像運行:npm config set registry https://registry.npm.taobao.org


免責聲明!

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



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