npm無法安裝node-sass的解決方法


使用npm install 命令安裝node-sass時,經常出現安裝失敗的情況。原因在於npm服務器在美國,還有就是某強大的防火牆作用。導致模塊無法下載。

1 npm install node-sass                                                      
1 Cannot download https://github.com/sass/node-sass/releases/download/v3.4.2/win32-x64-46_binding.node
2 
3 Hint: If github.com is not accessible in your location 4 try setting a proxy via HTTP_PROXY, e.g. 5 export HTTP_PROXY=http://example.com:1234
6 or configure npm proxy via 7 npm config set proxy http://example.com:8080'

 

解決方法:
1、使用淘寶鏡像完成安裝。

1 npm install -g cnpm --registry=https://registry.npm.taobao.org
2 cnpm install node-sass

2、下載翻牆軟件直接完成下載安裝


免責聲明!

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



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