npm使用国内源
npm使用国内源
$ 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 requires-port@1.x.x[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 hoek@2.x.xplatform unsupported babel-loader@7.1.2 › webpack@2.7.0 › watchpack@1.4.0 › chokidar@1.7.0 › 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 ajv@4.11.8 in /opt/uop-frontend/node_modules/_ajv-keywords@1.5.1@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 tunnel-agent@0.6.0
解决:
重复几次,多等些时间,后来就好了。
扩展阅读
使用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/
简介:
cnpmjs.org: Private npm registry and web for Company
So cnpm is meaning: Company npm.
npm使用国内源的更多相关文章
- npm 配置国内源
淘宝镜像 npm config set registry http://registry.npm.taobao.org
- 使用国内源(brew, pip, npm)
如果网络不行,安装依赖包的速度小于 100k/s 或者丢包严重导致安装很慢,我认为就应该使用国内源了.今天因为国内源的问题弄了很久,我觉得在国内服务器部署,全部应该从国内下载资源.分为两种情况, 存在 ...
- ubuntu和windows上pip和windows上conda国内源更新module
ubuntu上: -i http://pypi.douban.com/simple --trusted-host pypi.douban.com # pip install web.py -i htt ...
- ruby 编译安装,gem国内源ruby.taobao.org
centos6.6final 一.安装依赖包(使用默认CENTOS更新源): # yum install openssl* openssl-devel zlib-devel gcc gcc-c++ m ...
- 如何使用国内源部署Ceph?
由于网络方面的原因,Ceph的部署经常受到干扰,通常为了加速部署,基本上大家都是将Ceph的源同步到本地进行安装.根据Ceph中国社区的统计,当前已经有国内的网站定期将Ceph安装源同步,极大的方便了 ...
- linux 下各个工具使用(screen、tmux,pyenv、virtualenv,pip国内源,tree)
一.多会话工具screen.tmux 两个都是多窗口工具.1.使用后wim出现配色问题:http://ibartman.com/2014/04/16/vim%20%E9%85%8D%E8%89%B2/ ...
- Python pip 下载速度慢? Windows 设置 国内源,用 阿里云 国内镜像 加速
pip 提供了对 Python 包的查找.下载.安装.卸载的功能,是非常方便的 Python 包管理工具.但是,令人苦恼的是 pip 在国内的下载速度非常慢,速度常常只有每秒几十 K,甚至才几 K,小 ...
- Ubuntu ARM更改为国内源
关键词:ubuntu arm ubuntu-ports 国内源 镜像 阿里源 apt apt-get install update 0%working 速度慢 rk3399 开发板 ...
- Ubuntu18.04更换国内源(阿里,网易,中科大,清华等源)
1.备份 备份/etc/apt/sources.list文件 mv /etc/apt/sources.list /etc/apt/sourses.list.backup 2.新建 新建/etc/apt ...
随机推荐
- Java精通并发-轻量级锁与重量级锁的变化深入详解
在上一次https://www.cnblogs.com/webor2006/p/11446129.html的理论的最后谈到了锁的演化,如下: 下面具体来阐述一下: 偏向锁:它是针对一个线程来说, 它的 ...
- codevs 1341 与3和5无关的数
题目描述 Description 有一正整数a,如果它能被x整除,或者它的十进制表示法中某位上的数字为x,则称a与x相关.现求所有小于等于n的与3或5无关的正整数的平方和. 输入描述 Input De ...
- P3620 [APIO/CTSC 2007]数据备份[优先队列+贪心]
题目描述 你在一家 IT 公司为大型写字楼或办公楼(offices)的计算机数据做备份.然而数据备份的工作是枯燥乏味的,因此你想设计一个系统让不同的办公楼彼此之间互相备份,而你则坐在家中尽享计算机游戏 ...
- 项目(二)--完成练手feed流网站开发部署
样式需要优化,最简版,还需新增逻辑. 点击跳转 源码
- 大数据之路week07--day07 (Sqoop 从mysql增量导入到HDFS)
我们之前导入的都是全量导入,一次性全部导入,但是实际开发并不是这样,例如web端进行用户注册,mysql就增加了一条数据,但是HDFS中的数据并没有进行更新,但是又再全部导入一次又完全没有必要. 所以 ...
- szwyadmin程序漏洞拿shell【方法笔记】
我们在Google中搜索关键词 关键字:inurl:szwyadmin/login.asp 任意打开一个搜索结果,打开登录界面后在地址栏中输入下面的代码: 代码: javascript:alert(d ...
- 图解TCP/IP笔记
- PHP——汉字完美转为ASCII码
前言 对接联通的接口,让我学会了不少PHP偏门函数....,主要对方用的py,我这用的PHP,人家一个函数解决了, 我这还要自己写方法,也是比较蛋疼,但是学到东西还是很开心的~ 代码 字符串转为ASC ...
- 容错(Fault-tolerance)
Spark Streaming的容错包括了三个地方的容错: 1.Executor失败容错:Executor的失败会重新启动一个新的Executor,这个是Spark自身的特性.如果Receiver所在 ...
- Vue模板语法(一)
Vue模板语法 一 vue简介 Vue.js是一套构建用户界面的渐进式框架. 与其他重量级框架不同的是,Vue 采用自底向上增量开发的设计. Vue 的核心库只关注视图层,并且非常容易学习,非常容易与 ...