# 安装包与维护
# 安装
# 本地安装包
npm install xxx
# 全局安装包
npm install xxx -g
# 安装范围内的公共包
npm install @scope/xxx
# 安装私有包
npm install @scope/private-package-name
# 使用 dist-tags 安装包
npm install example-package@beta
# 检查更新
npm outdated
如果项目中安装的包远端有更新,则会提示,如:
Package Current Wanted Latest Location
my-very-awesome-npm-package 1.0.0 1.0.1 1.0.1 global
# 更新包
# 更新本地包
npm update xxx
# 更新全局包
npm update -g xxx
# 卸载包
npm uninstall xxx