使用npm安装一些包失败了的看过来(npm国内镜像介绍)

发布于 2012-4-26 04:19
最后一次编辑是 2013-12-11 23:21

这个也是网上搜的,亲自试过,非常好用!

镜像使用方法(三种办法任意一种都能解决问题,建议使用第三种,将配置写死,下次用的时候配置还在):

1.通过config命令

npm config set registry http://registry.cnpmjs.org
npm info underscore (如果上面配置正确这个命令会有字符串response)

2.命令行指定

npm --registry http://registry.cnpmjs.org info underscore 

3.编辑 ~/.npmrc 加入下面内容

registry = http://registry.cnpmjs.org

搜索镜像: http://cnpmjs.org

建立或使用镜像,参考: https://github.com/fenmgk2/cnpmjs.org

NPM 国内高速镜像


source: http://npm.cbyun.com/

# speed test
time npm --registry http://npm.cbyun.com install express # result--wtf?
npm --registry http://npm.cbyun.com install express 1.62s user 0.49s system 59% cpu 3.569 total

测试期频繁同步, 稳定后调整为每天凌晨自动同步一次

USAGE

  • 临时使用 npm --registry http://npm.cbyun.com install express

  • 持久使用 修改或者新建~/.npmrc,加入以下一行 registry = http://npm.cbyun.com/

TODO

  • npm-www
  • more test
  • sync with proxy

KNOWN ISSUSE

如果遇到 cache 报错

npm clean cache

FEEDBACK

NPM镜像设置方法!的更多相关文章

  1. 淘宝npm镜像使用方法

    镜像使用方法(三种办法任意一种都能解决问题,建议使用第三种,将配置写死,下次用的时候配置还在): 通过config命令npm config set registry https://registry. ...

  2. npm太慢, 淘宝npm镜像使用方法

    淘宝 npm 地址: http://npm.taobao.org/ 如何使用 有很多方法来配置npm的registry地址,下面根据不同情境列出几种比较常用的方法.以淘宝npm镜像举例: 1.临时使用 ...

  3. npm太慢, 淘宝npm镜像使用方法[转]

    淘宝 npm 地址: http://npm.taobao.org/ 如何使用 有很多方法来配置npm的registry地址,下面根据不同情境列出几种比较常用的方法.以淘宝npm镜像举例: 1.临时使用 ...

  4. 国内npm镜像使用方法

    npm全称Node Package Manager,是node.js的模块依赖管理工具.由于npm的源在国外,所以国内用户使用起来各种不方便.下面整理出了一部分国内优秀的npm镜像资源,国内用户可以选 ...

  5. NodeJS NPM 镜像使用方法

    每次npm的时候,走国外的镜像,非常的慢,可以配置一下 通过改变默认npm镜像代理服务,以下三种办法任意一种都能解决问题,建议使用第三种,将配置写死,下次用的时候不用重新配置. 通过config命令 ...

  6. 淘宝npm镜像使用方法(转)

    1.临时使用 npm --registry https://registry.npm.taobao.org install express 2.持久使用 npm config set registry ...

  7. centos7下载自定义仓库的镜像设置方法

    1.vim /usr/lib/systemd/system/docker.service Description=Docker Application Container Engine Documen ...

  8. npm 更改为淘宝镜像的方法

    1.命令行临时使用指定镜像(淘宝) npm --registry https://registry.npm.taobao.org install express 2.命令行永久更改使用指定镜像(淘宝) ...

  9. npm 如何设置镜像站为淘宝网

    转载 2015年06月24日 17:12:12 10542 淘宝镜像:http://npm.taobao.org/ 镜像使用方法(三种办法任意一种都能解决问题,建议使用第三种,将配置写死,下次用的时候 ...

随机推荐

  1. [Node.js] Pass command line arguments to node.js

    Command line arguments are often used to modify the behavior of an application or specify needed par ...

  2. iOS开发网络学习七:NSURLSession的基本使用get和post请求

    #import "ViewController.h" @interface ViewController () @end @implementation ViewControlle ...

  3. Android多线程研究(8)——Java5中Futrue获取线程返回结果

    我们先来看一下ExecutorService中的执行方法: 在上一篇中我们使用了execute方法启动线程池中的线程执行,这一篇我们来看看submit方法的使用:submit提交一个返回值的任务用于执 ...

  4. ios开发处理服务器返回的时间字符串

    #import <Foundation/Foundation.h> void other(); void string2date(); int main(int argc, const c ...

  5. ijkplayer阅读笔记02-创建音视频读取,解码,播放线程

    本节主要介绍音视频读取和解码线程的创建及启动,代码流程例如以下: IjkMediaPlayer_prepareAsync{ ijkmp_prepare_async_l{ ijkmp_change_st ...

  6. Android使用JNI实现Java与C之间传递数据

    介绍Java如何将数据传递给C和C回调Java的方法. java传递数据给C,在C代码中进行处理数据,处理完数据后返回给java.C的回调是Java传递数据给C,C需要用到Java中的某个方法,就需要 ...

  7. Passive DNS

    http://blog.csdn.net/cnbird2008/article/details/17250707 http://netsecurity.51cto.com/art/201510/494 ...

  8. Erlang/OTP 中文手册

    http://erldoc.com/ Open Telecom Platform application array asn1rt base64 binary calendar code dbg di ...

  9. 【序列操作III】线段树

    题目描述 给出序列 a1,a2,…an(0≤ai≤109),有关序列的四种操作: 1. al,al+1,…,ar(1≤l≤r≤n)加上 x(-103≤x≤103) 2. al,al+1,…,ar(1≤ ...

  10. 【无旋 treap】例题

    [bzoj3223]文艺平衡树 Description 您需要写一种数据结构(可参考题目标题),来维护一个有序数列,其中需要提供以下操作:翻转一个区间,例如原有序序列是5 4 3 2 1,翻转区间是[ ...