【填坑排错系列_npm篇】 持续更新

cnpm update -g升级包时提示以下错误
npm ERR! path D:\nodejs\npm.cmd
npm ERR! code EEXIST
npm ERR! Refusing to delete D:\nodejs\npm.cmd: is outside D:\nodejs\node_modules\npm and not a link
npm ERR! File exists: D:\nodejs\npm.cmd
npm ERR! Move it away, and try again.

不要使用cnpm,请使用npm

npm install 提示以下错误
npm ERR! path D:\vscodeProjects\node-vue-ele-app\client\node_modules\.staging\mongoose-9f9abeb5\lib\model.js
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'D:\vscodeProjects\node-vue-ele-app\client\node_modules\.staging\mongoose-9f9abeb5\lib\model.js'

以管理员权限运行cmd,并重新安装
可通过以下两种方式以管理员权限运行cmd

  • 在cmd程序上右键,选择“以管理员身份运行”
  • 打开普通的cmd窗口,输入runas /user:Administrator cmd后输入密码即可
发布了9 篇原创文章 · 获赞 4 · 访问量 3741

猜你喜欢

转载自blog.csdn.net/qq_38868135/article/details/103832006