首页 前端知识 npm ERR! code EPERMnpm ERR! syscall mkdirnpm ERR! path D:\ProgramFiles\nodejs\node_global\node_mod

npm ERR! code EPERMnpm ERR! syscall mkdirnpm ERR! path D:\ProgramFiles\nodejs\node_global\node_mod

2024-06-18 23:06:16 前端知识 前端哥 873 623 我要收藏

项目场景:npm install -g nodemon报错

报错如下·

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code EPERM
npm ERR! syscall mkdir
npm ERR! path D:\ProgramFiles\nodejs\node_global\node_modules\.staging
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, mkdir 'D:\ProgramFiles\nodejs\node_global\node_modules\.staging'
npm ERR!  [OperationalError: EPERM: operation not permitted, mkdir 'D:\ProgramFiles\nodejs\node_global\node_modules\.staging'] {
npm ERR!   cause: [Error: EPERM: operation not permitted, mkdir 'D:\ProgramFiles\nodejs\node_global\node_modules\.staging'] { 
npm ERR!     errno: -4048,
npm ERR!     code: 'EPERM',
npm ERR!     syscall: 'mkdir',
npm ERR!     path: 'D:\\ProgramFiles\\nodejs\\node_global\\node_modules\\.staging'
npm ERR!   },
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: 'D:\\ProgramFiles\\nodejs\\node_global\\node_modules\\.staging'
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 the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     D:\ProgramFiles\nodejs\node_cache\_logs\2024-01-11T13_06_26_574Z-debug.log

 报错原因 :

权限不足

解决方法1:

命令改成局部安装

npm  install nodemon

解决方法2:切换成超级管理员进行安装

 

安装成功 

转载请注明出处或者链接地址:https://www.qianduange.cn//article/12712.html
标签
评论
发布的文章

JQuery中的load()、$

2024-05-10 08:05:15

大家推荐的文章
会员中心 联系我 留言建议 回顶部
复制成功!