npm config
在公司为了不再用 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的更多相关文章
- npm config 删除变量
问题 安装npm时,使用npm config set 命令重新设置了变量,但是设置变量时少了个空格,设置错了.使用npm config ls -l 查看环境变量 添加错的这一个,应该如何删除? 解决 ...
- npm 取消代理 npm config delete proxy
今天在安装electron时设置了代理,发现再npm install 安装别的总是装不上,只好取消代理. npm 取消代理 npm config delete proxy
- npm & npm config
npm command show npm config https://docs.npmjs.com/cli/config https://docs.npmjs.com/cli/ls https:// ...
- 56.如何清除已经设置的npm config配置
npm config delete registry npm config delete disturl 或者 npm config edit 找到淘宝那两行,删除
- npm config set registry 与 cnpm的区别
一直以为这2个事没有区别的: npm config set registry http://registry.npm.taobao.org 后使用npm命令. npm install -g cnpm ...
- npm config set registry
npm config set registry $ npm config set registry $ npm config set registry https://registry.your-re ...
- npm & config settings
npm & config settings how to check npm config settings https://docs.npmjs.com/cli/config $ npm c ...
- npm reset config
To reset user defaults Run this in the command line (or git bash on windows): echo "" > ...
- [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 ...
随机推荐
- c++ 注册类到 lua
test.h: #ifndef __TEST_H__ #define __TEST_H__ class CTest { public: CTest(); ~CTest(); int getA(); v ...
- The Number Off of FFF
X soldiers from the famous “FFF army'' is standing in a line, from left to right. You, as the captai ...
- OC-《购票系统》
来个命令行的购票系统 --1-- 需求分析 1.1 分析 1.2 功能分析 1.3 流程分析 --2-- 原型展示 2.1 界面原型 --3-- 系统设计 3.1 类设计 3.2 框架模块设计 --4 ...
- Java,double类型转换成String,String装换成double型
今天,老师布置了小系统,银行用户管理系统,突然发现自己的基础知识好薄弱,就把这些记录一下, double类型转化string:Double.toString(double doub); String类 ...
- ADO 读取 ACCESS
#pragma once #include <vector> // 加入ADO支持库, #import "C:\Program Files\Common Files\System ...
- React Native for Android 学习笔记
C:\Users\Vic Lee\AwesomeProject>react-native run-android Starting JS server... Running D:\Android ...
- C#常用开源类库
一.AOP框架 Encase 是C#编写开发的为.NET平台提供的AOP框架.Encase 独特的提供了把方面(aspects)部署到运行时代码,而其它AOP框架依赖配置文件的方式.这种 ...
- 广播Broadcast Receiver
广播的类型: 1.标准广播(Normal broadcat) 完全异步执行的广播,所有广播接收器同一时间接收广播消息. 效率高,但无法被截断. 2.有序广播 同步执行的广播,同一时刻只能有一个广播接收 ...
- 一个简单的loading,纯属自娱自乐
/// <reference path="/scripts/js/jquery.min.js" /> var zsw = { loading: function (im ...
- 前台JS(type=‘file’)读取本地文件的内容,兼容各种浏览器
[自己测了下,能兼容各种浏览器,但是读取中文会出现乱码.自己的解决方法是用notepad++把txt文件编码改为utf-8(应该是和浏览器编码保持一致吧?..)] 原文 http://blog.cs ...