npmは国内ソースを使用

4660 ワード

$ npm install -g cnpm --registry=https://registry.npm.taobao.org
$ npm --registry=https://registry.npm.taobao.org install
$ cnpm install ⠸ [22/47] Installing stream-browserify@^2.0.1[npminstall:get] retry GET http://registry.npm.taobao.org/extglob/download/extglob-0.3.2.tgz after 100ms, retry left 4, error: ResponseError: socket hang up (req "error"), GET http://registry.npm.taobao.org/extglob/download/extglob-0.3.2.tgz -1 (connected: true, keepalive socket: true, agent status: {"createSocketCount":13,"createSocketErrorCount":0,"closeSocketCount":3,"errorSocketCount":0,"timeoutSocketCount":0,"requestCount":699,"freeSockets":{},"sockets":{"registry.npm.taobao.org:80:":10},"requests":{"registry.npm.taobao.org:80:":32}}) headers: {} ⠙ [22/47] Installing [email protected][npminstall:get] retry GET http://registry.npm.taobao.org/util-deprecate after 100ms, retry left 4, error: ResponseError: socket hang up (req "error"), GET http://registry.npm.taobao.org/util-deprecate -1 (connected: true, keepalive socket: true, agent status: {"createSocketCount":14,"createSocketErrorCount":0,"closeSocketCount":4,"errorSocketCount":0,"timeoutSocketCount":0,"requestCount":725,"freeSockets":{},"sockets":{"registry.npm.taobao.org:80:":10},"requests":{"registry.npm.taobao.org:80:":29}}) headers: {} ⠙ [44/47] Installing [email protected] unsupported [email protected][email protected][email protected][email protected] › fsevents@^1.0.0 Package require os(darwin) not compatible with your platform(linux) [fsevents@^1.0.0] optional install error: Package require os(darwin) not compatible with your platform(linux) ✔ Installed 47 packages ✔ Linked 570 latest versions ✔ Run 0 scripts peerDependencies link [email protected] in/opt/uop-frontend/node_modules/[email protected]@ajv-keywords unmet with/opt/uop-frontend/node_modules/ajv(5.2.2) Recently updated (since 2017-08-22): 9 packages (detail see file/opt/uop-frontend/node_modules/.recently_updates.txt) ✔ All packages installed (666 packages installed from npm registry, used 1m, speed 344.94kB/s, json 617(7.53MB), tarball 20.59MB)
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'; color: #3597fc}p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Lucida Grande'}span.s1 {color: #000000}span.s2 {text-decoration: underline}span.s3 {text-decoration: underline ; color: #3597fc}table.t1 {border-collapse: collapse}td.td1 {border-style: solid; border-width: 1.0px 1.0px 1.0px 1.0px; border-color: #cbcbcb #cbcbcb #cbcbcb #cbcbcb; padding: 0.0px 5.0px 0.0px 5.0px}
$ npm --registry=https://registry.npm.taobao.org install npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents): npm WARN network SKIPPING OPTIONAL DEPENDENCY: getaddrinfo ENOTFOUND registry.npm.taobao.org registry.npm.taobao.org:443
問題と解決
質問:
$ npm install -g cnpm --registry=https://registry.npm.taobao.org
....
[               ...] / extract:moment: verb gentlyRm don't care about contents; nuking /usr/lib/node_modules/.staging/moment-846e294d/node_modules
......     .......
[               ...] / preinstall:cnpm: sill doParallel preinstall 643
......     .......
[               ...] \ build:tunnel-agent: verb linkMans [email protected]




解決:
    ,     ,     。


拡張読書
npmを使用してパッケージをインストールできませんでした(npm国内ミラー紹介)http://cnodejs.org/topic/4f9904f9407edba21468f31e 概要:

1.  config  
npm config set registry https://registry.npm.taobao.org npm info underscore (                 response)

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

3.  ~/.npmrc
      
registry = https://registry.npm.taobao.org

    : [https://npm.taobao.org](https://npm.taobao.org/)
       ,  : [https://github.com/cnpm/cnpmjs.org](https://github.com/cnpm/cnpmjs.org)


宝を洗うNPMの鏡像https://npm.taobao.org/概要:
   NPM      。

$ npm install -g cnpm --registry=https://registry.npm.taobao.org

$ cnpm install [name]



国内優秀npmミラーの推薦と使用
http://blog.csdn.net/cengjingcanghai123/article/details/45045265
概要:
宝を洗うnpm鏡像
検索アドレス:http://npm.taobao.org/registryアドレス:http://registry.npm.taobao.org/
cnpmjsミラー
検索アドレス:http://cnpmjs.org/registryアドレス:http://r.cnpmjs.org/
https://cnpmjs.org/
概要:
cnpmjs.org: Private npm registry and web for Company
So cnpm is meaning: Company npm.