npm相关命令行记录
查看本地npm安装包目录#
npm config get prefix
全局添加包#
npm install http-server -g
卸载已安装的包#
npm uninstall http-server -g
查看配置#
npm config list
查看npm镜像设置#
npm config get registry
将npm设置镜像#
# 默认
npm config set registry http://registry.npmjs.org
# 淘宝
npm config set registry https://registry.npm.taobao.org
设置代理#
npm config set proxy=http://192.168.2.1:8080
https代理#
npm config set https-proxy http://server:port
用户名和密码代理#
npm config set proxy http://user:pwd@server:port
# 或
npm config set https-proxy https://user:pwd@server:port
取消代理#
npm config delete proxy
npm config delete https-proxy
清理缓存#
npm cache clean --force
版本降级#
npm -g i npm@4
查看全局安装的包#
npm list -g --depth 0