查看配置文件路径
$ npm config get userconfig//用户配置
$ npm config get globalconfig//全局配置
查看设置
$ npm config ls
$ npm config ls -l
删除代理
$ npm config delete proxy
$ npm config delete https-proxy
设置代理
$ npm config set proxy http://server:port
$ npm config set https-proxy http://server:port
$ npm config set proxy http://username:password@server:port
$ npm config set https-proxy http://username:pawword@server:port
install依赖包
$ npm install express
$ npm install express -g
update依赖包
$ npm update
$ npm update express
$ npm update express -g
uninstall依赖包
$ npm uninstall express
其他命令
npm -v
npm list
关于node版本更新
对于window用户--重新安装覆盖
对于mac用户
$ node -v
$ sudo npm cache clean -f
$ sudo npm install -g n
$ sudo n stable
//$ sudo n v9.2.0
$ node -v
$ which node