- 查看
npm当前版本
$ npm -v
- 更新到最新版本
$ npm install -g npm
- 更新到指定版本
$ npm -g install npm@6.8.0
- 清理
npm缓存数据
$ npm cache clean --force
npm 当前版本$ npm -v
$ npm install -g npm
$ npm -g install npm@6.8.0
npm 缓存数据$ npm cache clean --force