# NPM设置淘宝镜像


淘宝npm镜像是国内最大的，访问速度快的npm镜像，设置方法如下：

- 编辑 ~/.npmrc

  ```shell
   registry = http://registry.npm.taobao.org
  ```
- by config command

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

- 命令行指定

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

