npm-check 是用来检查 npm 依赖包是否有更新,错误以及不在使用的,我们也可以使用 npm-check 进行包的更新。

安装npm-check:

npm install -g npm-check

检查npm包的状态:

npm-check -u -g

通过上下键可以移动光标,使用空格键可以选择需要处理的包,回车直接进行处理。选择 [email protected] 包升级到 3.10.3:

? Choose which packages to update. [email protected]

$ npm install --global [email protected] --color=always

/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
/usr/local/lib
└─┬ [email protected]
  ├── [email protected]
  ├── [email protected]
  └── [email protected]

[npm-check] Update complete!
[npm-check] [email protected]
[npm-check] You should re-run your tests to make sure everything works with the updates.

npm outdated 可查看那些包比较旧

标签: nodejs, npm

添加新评论