npm WARN locking errno: -4048,npm WARN locking code: 'EPERM',npm WARN locking syscall: 'open',


D:\Code\Project\2021-3-1\ruoyi-vue\ruoyi-ui>npm install
npm WARN locking Error: EPERM: operation not permitted, open ‘D:\Environment\nodejs\node_cache_locks\staging-9ac46eb88defb0e8.lock’
npm WARN locking D:\Environment\nodejs\node_cache_locks\staging-9ac46eb88defb0e8.lock failed [Error: EPERM: operation not permitted, open ‘D:\Environment\nodejs\node_cache_locks\staging-9ac46eb88defb0e8.lock’] {
npm WARN locking errno: -4048,
npm WARN locking code: ‘EPERM’,
npm WARN locking syscall: ‘open’,
npm WARN locking path: ‘D:\Environment\nodejs\node_cache\_locks\staging-9ac46eb88defb0e8.lock’
npm WARN locking }
npm ERR! code EPERM
npm ERR! syscall open
npm ERR! path D:\Environment\nodejs\node_cache_locks\staging-9ac46eb88defb0e8.lock
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, open ‘D:\Environment\nodejs\node_cache_locks\staging-9ac46eb88defb0e8.lock’
npm ERR! [Error: EPERM: operation not permitted, open ‘D:\Environment\nodejs\node_cache_locks\staging-9ac46eb88defb0e8.lock’] {
npm ERR! errno: -4048,
npm ERR! code: ‘EPERM’,
npm ERR! syscall: ‘open’,
npm ERR! path: 'D:\Environment\nodejs\node_cache\_locks\staging-9ac46eb88defb0e8.lock’

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.

解决方案:
1,使用管理员权限打开idea,再在terminal上运行npm install;这个问题的原因就是没有管理员权限造成的。同样的在Windows的cmd的使用也需要管理员权限。

Logo

快速构建 Web 应用程序

更多推荐