在公司为了不再用 npm --registry=http://r.cnpmjs.org install -(g) xxx 就设置了内部的镜像文件地址为默认的代理地址

npm config set registry http://r.cnpmjs.org

蛋疼的后来发现离开了公司的网络就install不成功了。原来只能呢内网可以。

后来找了一下相关资料。
发现删除npm镜像设置代理或者镜像的时候可以用 delete删除恢复

npm config delete registry

然后会自动恢复到"https://registry.npmjs.org/"

其他的命令:
针对npm配置的命令行操作如下(可使用命令npm help config查询):

npm config set <key> <value> [--global]
npm config get <key>
npm config delete <key>
npm config list
npm config edit
npm get <key>
npm set <key> <value> [--global]
npm config get userconfig ----- 获取当前用户文件路径
npm config get globalconfig ---------- 获取全局文件路径
npm config ls -l 【如果查看npm的所有配置属性。注意:以;开头的为注释。】 npm install xxx -g[全局安装] 和 不需要-g的区别
. npm install xxx -g 时, 模块将被下载安装到【全局目录】中。
【全局目录】通过 npm config set prefix "目录路径" 来设置。
全局目录的设置:
npm config set prefix "路径"
也可以配置环境变量:添加npm_config_prefix属性即可。
. npm install xxx ,则是将模块下载到当前命令行所在目录。
npm install xxx 安装模块
npm install xxx@1.1. 安装1..1版本的xxx
npm install xxx -g 将模块安装到全局环境中。
npm ls 查看安装的模块及依赖
npm ls -g 查看全局安装的模块及依赖
npm uninstall xxx (-g) 卸载模块
npm cache clean 清理缓存
npm help xxx 查看帮助
npm view moudleName dependencies 查看包的依赖关系
npm view moduleNames 查看node模块的package.json文件夹
npm view moduleName labelName 查看package.json文件夹下某个标签的内容
npm view moduleName repository.url 查看包的源文件地址
npm view moduleName engines 查看包所依赖的Node的版本
npm help folders 查看npm使用的所有文件夹
npm rebuild moduleName 用于更改包内容后进行重建
npm outdated 检查包是否已经过时,此命令会列出所有已经过时的包,可以及时进行包的更新
npm update moduleName 更新node模块

$ git remote -v
这个命令可以显示对应项目的远程克隆地址。

npm config的更多相关文章

  1. npm config 删除变量

    问题 安装npm时,使用npm config set 命令重新设置了变量,但是设置变量时少了个空格,设置错了.使用npm config ls -l 查看环境变量 添加错的这一个,应该如何删除? 解决 ...

  2. npm 取消代理 npm config delete proxy

    今天在安装electron时设置了代理,发现再npm install 安装别的总是装不上,只好取消代理. npm 取消代理 npm config delete proxy

  3. npm & npm config

    npm command show npm config https://docs.npmjs.com/cli/config https://docs.npmjs.com/cli/ls https:// ...

  4. 56.如何清除已经设置的npm config配置

    npm config delete registry npm config delete disturl 或者 npm config edit 找到淘宝那两行,删除

  5. npm config set registry 与 cnpm的区别

    一直以为这2个事没有区别的: npm config set registry http://registry.npm.taobao.org 后使用npm命令. npm install -g cnpm ...

  6. npm config set registry

    npm config set registry $ npm config set registry $ npm config set registry https://registry.your-re ...

  7. npm & config settings

    npm & config settings how to check npm config settings https://docs.npmjs.com/cli/config $ npm c ...

  8. npm reset config

    To reset user defaults Run this in the command line (or git bash on windows): echo "" > ...

  9. [NPM] Use custom config settings in your npm scripts

    In addition to package.json level variables (such as name and version), you can have custom conf set ...

随机推荐

  1. JavaScript界面传值与前后台互调

    话说曾在校时,前端的第一门课程HTML静态网页设计,其老师,真是应了他的名字: 路遥知马力. 整个学期硬是全部在 Dreamwear 中进行拖拽控件来教学,未曾教授一句代码.成功忽悠了全体学生,课上一 ...

  2. php常用string函数

    http://www.w3school.com.cn/php/php_ref_string.asp1.addcslashes() 返回在指定的字符前添加反斜杠的字符串2.addslashes() 返回 ...

  3. 获取WOED和EXCEL的公用方法

    1. 需要传入word地址 /// <summary> /// 获取WORD内容 /// </summary> /// <param name="docFile ...

  4. 【Python】Django

    数据表更改 Django 1.7.x 和后来的版本: Django 1.7.x 及以后的版本集成了 South 的功能,在修改models.py了后运行: python manage.py makem ...

  5. Redhat、CentOS添加静态路由的标准方法

    我们经常遇到需要在系统默认路由的基础上,额外添加静态路由的需求.为了使得下次系统启动这些静态路由依旧生效,我们可能采取在rc.loal里加入route命令追加静态路由的方法. 现在给大家推荐Redha ...

  6. jquery.Huploadify 上传

    html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3 ...

  7. Duiib 创建不规则窗口(转载)

    方法一: 转载:http://blog.csdn.net/chenlycly/article/details/46447297 转载:http://blog.csdn.net/harvic880925 ...

  8. 设计一个泛型类orderedCollection

    设计一个泛型类orderedCollection,它存储的Comparable对象的集合(在数组中),以及该集合的当前大小.提供public方法isEmpty,makeEmpty,insert,rem ...

  9. 【转载】我眼中的Oracle性能优化

    我眼中的Oracle性能优化 大家对于一个业务系统的运行关心有如下几个方面:功能性.稳定性.效率.安全性.而一个系统的性能有包含了网络性能.应用性能.中间件性能.数据库性能等等. 今天从数据库性能的角 ...

  10. 微信小程序-视图视图引用

    引用 WXML 提供两种文件引用方式import和include. import import可以在该文件中使用目标文件定义的template,如: 在 item.wxml 中定义了一个叫item的t ...