npm命令

npm/yarn config set registry https://registry.npm.taobao.org 设置淘宝镜像
npm/yarn config get registry 查看当前镜像
npm --registry https://registry.npm.taobao.org install express 临时使用
npm outdated 查询依赖版本是否是最新

npm list name 查看服务器上依赖包的版本信息

npm view name 显示服务器上依赖包的最新版本信息

npm ls name 查看本地安装包的版本信息

npm cache verify 验证缓存

npm cache clean --force 清理缓存

node-sass安装失败解决方法 npm/yarn config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/ 

nrm 淘宝镜像管理工具 需要全局安装

nrm ls 查看所有可用镜像

nrm use taobao 使用某种镜像

n 不带参数查看当前安装的nodejs版本
n --help 查看帮助
n ls 查看node可用版本
n rm 8.0.0 删除某个版本
n use 8.0.0 server.js 指定运行版本

n lts  Error: sudo required解决方法 运行 sudo n lts

 

原文地址:https://www.cnblogs.com/nightstarsky/p/8316166.html