美文网首页
npm 淘宝镜像及使用

npm 淘宝镜像及使用

作者: 静候那一米阳光 | 来源:发表于2017-05-16 11:29 被阅读0次

淘宝npm镜像

搜索地址:http://npm.taobao.org/
registry地址:http://registry.npm.taobao.org/

使用说明

临时使用

npm --registry https://registry.npm.taobao.org install express

持久使用

npm config set registry https://registry.npm.taobao.org

// 配置后可通过下面方式来验证是否成功
npm config get registry
// 或
npm info express

通过cnpm使用

使用定制的cnpm命令行工具代替默认的npm

$ npm install -g cnpm --registry=https://registry.npm.taobao.org

或者你直接通过添加 npm 参数 alias 一个新命令:

alias cnpm="npm --registry=https://registry.npm.taobao.org \
--cache=$HOME/.npm/.cache/cnpm \
--disturl=https://npm.taobao.org/dist \
--userconfig=$HOME/.cnpmrc"

# Or alias it in .bashrc or .zshrc
$ echo '\n#alias for cnpm\nalias cnpm="npm --registry=https://registry.npm.taobao.org \
  --cache=$HOME/.npm/.cache/cnpm \
  --disturl=https://npm.taobao.org/dist \
  --userconfig=$HOME/.cnpmrc"' >> ~/.zshrc && source ~/.zshrc

整合自 http://riny.net/2014/cnpm/http://npm.taobao.org/

相关文章

  • node操作数据库mysql

    1.使用淘宝镜像原因:国内直接使用 npm 的官方镜像是非常慢的,所以推荐使用淘宝 NPM 镜像。淘宝 NPM 镜...

  • npm包安装,上传

    将npm的镜像源替换淘宝镜像 如果使用npm安装包时下载太慢,可以将npm的镜像源替换为淘宝镜像:镜像使用方法(三...

  • NPM使用淘宝镜像

    大家都知道国内直接使用 npm 的官方镜像是非常慢的,这里推荐使用淘宝 NPM 镜像。 淘宝 NPM 镜像是一个完...

  • [读] npm太慢, 淘宝npm镜像使用方法

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

  • Vue2.0项目入门 — 从环境搭建到运行

    环境安装 安装淘宝镜像大家都知道国内直接使用 npm 的官方镜像是非常慢的,这里推荐使用淘宝 NPM 镜像。下载...

  • npm 配置淘宝镜像

    1、配置 npm 为淘宝镜像 安装包时, npm install ,即使用镜像 2、安装 cnpm 为淘宝镜像 安...

  • npm intall太慢

    安装cnpm 使用cnpm来替代npm淘宝 NPM 镜像地址

  • npm换源

    使用淘宝镜像 临时使用npm --registry https://registry.npm.taobao.org...

  • 淘宝镜像切换相关操作

    使用淘宝镜像npm路径:npm config set registry https://registry.npm....

  • Vue-cli 安装

    建议 由于使用 npm 安装Vue-cli比较缓慢,建议安装淘宝镜像; 淘宝镜像:npm install -g c...

网友评论

      本文标题:npm 淘宝镜像及使用

      本文链接:https://www.haomeiwen.com/subject/lqclxxtx.html