在公司为了不再用 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. ThreadLocal的理解

    ThreadLocal 不是用来解决共享对象的多线程访问问题的,一般情况下,通过ThreadLocal.set() 到线程中的对象是该线程自己使用的对象,其他线程是不需要访问的,也访问不到的.每个线程 ...

  2. webapi mvc session一直获取不到问题

    前一段时间在给移动端写接口时遇到一个调用接口发送邮箱 session 一直获取不到的问题.我来给遇到问题的同志们说一说 自个在网上查了好多资料,问了一些朋友后.终于找到解决方案了. 大家都知道weba ...

  3. Cocosd-x的坐标系

    OpenGL 坐标系 :   原点在屏幕左下角,x 轴向右,y 轴向上. UI坐标体系       :   原点在屏幕左上角,x 轴向右,y 轴向下. 屏幕坐标系:    UI 世界坐标系:  也叫绝 ...

  4. AndroidManifest.xml详解(下)

    本文编辑整理自:http://blog.163.com/hero_213/blog/static/39891214201242835410742/ 八.第三层<activity-alias> ...

  5. Radmin Server-3.5 完美绿色破解版(x32 x64通用) 第三版 + 单文件制作方法

    Radmin Server v3.5 汉化破解绿色版(x32 x64通用) 第三版 下载链接: https://pan.baidu.com/s/1qYVcSQo 2016年7月8日更新第三版1.修复在 ...

  6. js跨域访问,No 'Access-Control-Allow-Origin' header is present on the requested resource

    js跨域访问提示错误:XMLHttpRequest cannot load http://...... No 'Access-Control-Allow-Origin' header is prese ...

  7. Ad hoc sql

    SQL Server如何启用Ad Hoc Distributed Queries? 2011-08-11 14:53 wangdingbang CSDN博客 字号:T | T   本文主要介绍了SQL ...

  8. 手机响应式js轮播基础

    onmousedown --->ontuchstart onmousemove --->ontouchmove onmouseup --->ontouchend ontuchstar ...

  9. Tips collection of iOS development

    <转>UITableView当数据很少的时候,去掉多余的cell分割线   在tableView初始化的时候 UIView *v = [[UIViewalloc] initWithFram ...

  10. QT连接MySQL

    Qt 连接MySQL 是件很简单的事,但也有可能很不简单. QT给我们的提示只有 QMYSQL driver not loaded,让我们毫无头绪.访问其他数据库也可以用同样的方法解决. Qt 访问 ...