npm國內鏡像


     npm 是node.js 環境下的包管理器,非常強大智能,我們在使用node的時候經常需要安裝各種npm包,但是國內牆的太厲害了,下載npm包真是下的着急。

  比較幸運的是,國內有幾個鏡像站點可以供我們使用,如 http://www.cnpmjs.org/   https://registry.npm.taobao.org 

  npm源:

  npm ---- https://registry.npmjs.org/
  cnpm --- http://r.cnpmjs.org/
  taobao - http://registry.npm.taobao.org/
  eu ----- http://registry.npmjs.eu/
  au ----- http://registry.npmjs.org.au/
  sl ----- http://npm.strongloop.com/
  nj ----- https://registry.nodejitsu.com/

  

  如何給本機換npm源呢:

  (1)通過 config 配置指向國內鏡像源

npm config set registry https://registry.npm.taobao.org 
npm info underscore (如果上面配置正確這個命令會有字符串response)

  (2)通過 npm 命令指定下載源

npm --registry https://registry.npm.taobao.org info underscore 

  (3)在配置文件 ~/.npmrc 文件寫入源地址

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

 

  搜索鏡像: https://npm.taobao.org

  建立或使用鏡像,參考: https://github.com/cnpm/cnpmjs.org

資料參考:

 更換 npm 源國內鏡像 cnpm:http://nodeclass.com/articles/811495

 使用npm安裝一些包失敗了的看過來(npm國內鏡像介紹): https://cnodejs.org/topic/4f9904f9407edba21468f31e

 淘寶npm源國內鏡像:http://npm.taobao.org/  


免責聲明!

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



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