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 ...
随机推荐
- k8s安装之grafana.yaml
这个作展示,够用. 为了使用nginx统一管理, 这里将grafana放在子目录下. - name: GF_SERVER_ROOT_URL value: "%(protocol)s://% ...
- 29.LINQ初探
本页内容: 1.LINQ查询语言的组成部分: 2.使用LINQ方法语法: 3.排序查询结果 orderby 字句: 4.聚合运算符: 5.查询复杂对象: 6.投影:在查询中创建新对象: 7.Disti ...
- Django示例演示--?
引用自:https://blog.csdn.net/weixin_42950386/article/details/83143293 定义模型类 模型类被定义在"应用/models.py&q ...
- CSS滑动门
如下图所示,每个导航栏目的文字个数不一样多,有的长,有的短,如何用一张背景图片,适应不同字数”的导航条,“滑动门”设计的非常巧妙,采用两个相同的背景图像,一左一右,一个负责提供左边框,一个负责提供右边 ...
- 洛谷 P5436 【XR-2】缘分 题解
P5436 [XR-2]缘分 题目背景 世间万物都置身于缘分编织的大网中.缘分未到,虽历经千劫,却不能相遇.缘分到了,在草原上都能等到一艘船.--<一禅小和尚> 题目描述 一禅希望知道他和 ...
- 洛谷 P1147 连续自然数和 题解
P1147 连续自然数和 题目描述 对一个给定的自然数MM,求出所有的连续的自然数段,这些连续的自然数段中的全部数之和为MM. 例子:1998+1999+2000+2001+2002 = 100001 ...
- IntelliJ IDEA 2017 JDK Tomcat Maven 配置步骤详解(一)
要求 配置 Java基础环境(实际上应该在虚拟机linux环境下 安装CentOS 7,但是我这电脑实在承受不住了) 安装 开发工具 IntelliJ IDEA 2017.1 第一部分: JDK ...
- 【转】浅析Linux中的零拷贝技术
本文探讨Linux中主要的几种零拷贝技术以及零拷贝技术适用的场景.为了迅速建立起零拷贝的概念,我们拿一个常用的场景进行引入: 引文## 在写一个服务端程序时(Web Server或者文件服务器),文件 ...
- select和C标签
<select name="cpcyModel.rwzj" id="cpcyModel_rwzj"> <option value=" ...
- 深入理解document.referrer的用法
前言 在JavaScript中,document对象有很多属性,其中有3个与对网页的请求有关的属性,它们分别是URL.domain和referrer. URL属性包含页面完整的URL,domain属性 ...