一、临时使用

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

二、永久使用

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

通过

npm config get registry 查看是否配置成功

npm config list #查看npm当前配置


或者

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

registry= https://registry.npm.taobao.org

三、通过cnpm使用

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

四、设置回官网

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

五、强制清理npm的缓存

npm cache clear --force

npm config delete registry
npm config delete disturl

四、内网环境搭建私有npm服务

三、如何设置npm镜像的更多相关文章

  1. 安装cnpm设置npm淘宝镜像源

    安装cnpm npm install -g cnpm 验证npm镜像源 npm config get registry 题外话:cnpm和npm区别? cnpm其实就是在npm的基础上将镜像源更换到国 ...

  2. 国内npm镜像源设置

    淘宝npm镜像 搜索地址:http://npm.taobao.org/ registry地址:http://registry.npm.taobao.org/ cnpmjs镜像 搜索地址:http:// ...

  3. nexus设置npm下载管理

    nexus设置npm下载管理 第一步 登录私服网页 第二步 创建存储空间(如果使用默认的存储空间,此步骤可省略) 第三步 输入空间的名称,点击create创建 第四步 创建仓库 npm的仓库有三种: ...

  4. 国内优秀npm镜像

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

  5. NodeJS NPM 镜像使用方法

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

  6. 设置npm的registry

    .原npm地址 npm config set registry http://registry.npmjs.org .设置国内镜像 a.通过config命令 npm config set regist ...

  7. npm镜像地址的修改或切换

    方法一:直接编辑npm的配置文件npm config edit修改registry的地址registry=https://registry.npm.taobao.org 方法二:用代码更改npm的配置 ...

  8. Visual Studio 中设置npm

    VS2017自带的npm会去国外的镜像下载文件, 奇慢无比, 还是马云家淘宝的镜像适合国内用户. 淘宝npm镜像地址:  https://registry.npm.taobao.org VS中使用淘宝 ...

  9. npm镜像安装

    安装淘宝NPM镜像 https://npm.taobao.org/ npm install -g cnpm --registry=https://registry.npm.taobao.org 配置 ...

随机推荐

  1. June 14. 2018 Week 24th Thursday

    Good friends, good books, and a sleepy conscience: this is the ideal life. 拥有益友.良书和一颗宁静的内心:这就是理想的生活. ...

  2. February 18th, 2018 Week 8th Sunday

    Don't cry for what is lost. Smile for what still remains. 别为失去的哭泣,为还留在你身边的一切微笑吧. I have been told th ...

  3. oracle windows 新建用户授权 导出导入bmp文件

    1.新建用户 sqlplus /no log conn /as sysdba create user tkjj identified by tkjj2017 grant dba to tkjj con ...

  4. 自己动手写处理器之第二阶段(1)——可编程逻辑器件与PLD电路设计流程

    将陆续上传本人写的新书<自己动手写处理器>(尚未出版),今天是第五篇,我尽量每周四篇         通过上一章的介绍,读者应该知道CPU内部有一些主要的电路,比方:译码电路.运算电路.控 ...

  5. Your kernel does not support swap limit capabilities.memory limit without swap

    原因是:由于内核不支持限制内存的设置 解决办法是:vim /etc/default/grub 修改为: 或者:GRUB_CMDLINE_LINUX="cgroup_enable=memory ...

  6. apache和nginx结合使用

    1  有时候我们希望将nginx和apache结合起来使用,nginx接受用户的请求,作为请求转发服务器,apache作为后端服务器. 2 配置如下 nginx 中将80端口的请求转发到8000端口上 ...

  7. vue的过滤器语发及应用案例

    1.使用地方: 双花括号插值处或  组件属性处   例: {{ message | capitalize }} <div v-bind:id="rawId | formatId&quo ...

  8. python笔记31-使用ddt报告出现dict() -> new empty dictionary dict(mapping) 问题解决

    使用ddt框架生成html报告的时候,出现:dict() -> new empty dictionary dict(mapping) -> new dictionary initializ ...

  9. 电脑如何用HDMI连接电视

    因为现在的液晶电视基本上都有VGA接口,所以你可以很容易地用VGA线实现电脑连接电视上,但是该文有一个地方没有提到,那就是分辨率的问 题,现在的液晶电视的主流面板已经是全高清面板(1920X1080) ...

  10. spring-config的坑

    背景 1.修改配置中心读取配置文件的分支,配置了spring.cloud.config.label后,报错,异常大概是读取本地配置文件异常 解决 反复尝试了之后,发现是配置仓库的配置文件格式(yml) ...