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 ...
随机推荐
- [LeetCode] 0279. Perfect Squares 完全平方数
题目 Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9 ...
- java架构
技术架构是以Spring Framework为核心容器,Spring MVC为模型视图控制器,MyBatis作为数据访问层, Apache Shiro为权限授权层,使用Ehcahe对常用数据进行缓存. ...
- python开发笔记-python-numpy
一.Numpy概念 Numpy(Numerical Python的简称)是Python科学计算的基础包.它提供了以下功能: 除了为Python提供快速的数组处理能力,Numpy在数据分析方面还有另外 ...
- GITHUB添加SSH内容
首先,你需要注册一个 github账号,最好取一个有意义的名字,比如姓名全拼,昵称全拼,如果被占用,可以加上有意义的数字. 本文中假设用户名为 chuaaqiCSDN(我的博客名的全拼) 一.gihu ...
- 从GITHUB下载源码
从昨天开始就想着从GitHub上下载一个开源的Vue的实战项目,希望能从中学习更多的Vue的实用内容,结果搞了半天好不容易下载了,不知道怎么弄.然而,今天终于成功了,激动地我赶紧来记录一下. 如何从G ...
- 微信小程序WEB工具安装
1.下载工具链接:http://mp.weixin.qq.com/debug/wxadoc/dev/devtools/download.html?t=201715 2.安装完成后图片样式如图: 3.新 ...
- @NotNull,@NotEmpty,@NotBlank区别
示例结果: // null String name = null; @NotNull: false @NotEmpty: false @NotBlank: false // 空字符串 String n ...
- Mybatis 入门 (二)
1. Mapper配置文件处理特殊字符 用 > 和 &It; 代替 > 和 < 2. 延迟加载 单表查询性能比多表关联查询要高得多,即先查询单表,如果需要关联多表时再进行查询 ...
- 使用HttpClient进行Get方式通信(使用HttpGet获取网页数据)
1.项目结构 导入jar包 jar包去官网下载解压后项目新建lib目录,将解压包中的lib目录中的zip拷入项目lib目录文件夹,然后build path-->配置到项目中 2.TestGet. ...
- 【Redis】Linux下Redis的安装
Redis服务安装 主要有两种方式:apt安装和编译安装. 我采用的是apt安装,系统是ubuntu18.04,Redis version 5:4.0.9-1 在 Ubuntu 系统安装 Redi 可 ...