100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > npm 更新VUE package.json文件中依赖的包版本

npm 更新VUE package.json文件中依赖的包版本

时间:2018-10-15 02:22:41

相关推荐

npm 更新VUE package.json文件中依赖的包版本

1.安装npm install -g npm-check-updates

可能会出现以下错误:

npm ERR! syscall mkdirnpm ERR! path D:\node\node_global\node_modules\npm-check-updatesnpm ERR! errno -4048npm ERR! Error: EPERM: operation not permitted, mkdir 'D:\node\node_global\node_modules\npm-check-updates'npm ERR! [Error: EPERM: operation not permitted, mkdir 'D:\node\node_global\node_modules\npm-check-updates'] {npm ERR! errno: -4048,npm ERR! code: 'EPERM',npm ERR! syscall: 'mkdir',npm ERR! path: 'D:\\node\\node_global\\node_modules\\npm-check-updates'npm ERR! }npm ERR! npm ERR! The operation was rejected by your operating system.npm ERR! It's possible that the file was already in use (by a text editor or antivirus),npm ERR! or that you lack permissions to access it.npm ERR! npm ERR! If you believe this might be a permissions issue, please double-check thenpm ERR! permissions of the file and its containing directories, or try runningnpm ERR! the command again as root/Administrator.npm ERR! A complete log of this run can be found in:npm ERR!D:\node\node_cache\_logs\-03-07T06_46_10_432Z-debug-0.log

以上错误的原因:

没有权限创建文件夹

解决方案:使用CMD命令,用管理员打开,在该目录下执行该命令

2.执行下面命令(显示当前目录下项目中所有新的依赖包)

ncu

3.更新项目package文件

ncu -u

以上操作完毕之后,查看package.json 文件,可以看到依赖包已经更新

关于npm-check-updates更多用法,请查看npm-check-updates - npm

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。