解决报错npm ERR! code EPERMnpm ERR! syscall open
一、报错怎么解决
1、报错代码示例
PS E:\sinosoft\epms\epms-web> npm install
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@achrinza/node-ipc@9.2.2',
npm WARN EBADENGINE required: { node: '8 || 10 || 12 || 14 || 16 || 17' },
npm WARN EBADENGINE current: { node: 'v18.17.1', npm: '9.6.7' }
npm WARN EBADENGINE }
npm ERR! code EPERM
npm ERR! syscall open
npm ERR! path D:\Program Files (x86)\nodejs\node_cache\_cacache\tmp\5265f024
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, open 'D:\Program Files (x86)\nodejs\node_cache\_cacache\tmp\5265f024'
npm ERR! [Error: EPERM: operation not permitted, open 'D:\Program Files (x86)\nodejs\node_cache\_cacache\tmp\5265f024'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'open',
npm ERR! path: 'D:\\Program Files (x86)\\nodejs\\node_cache\\_cacache\\tmp\\5265f024'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
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! You can rerun the command with `--loglevel=verbose` to see the logs in your terminal
PS E:\sinosoft\epms\epms-web> npm run serve
> vue-project@0.1.0 serve
> SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve
'vue-cli-service' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
PS E:\sinosoft\epms\epms-web> npm install
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@achrinza/node-ipc@9.2.2',
npm WARN EBADENGINE required: { node: '8 || 10 || 12 || 14 || 16 || 17' },
npm WARN EBADENGINE current: { node: 'v18.17.1', npm: '9.6.7' }
npm WARN EBADENGINE }
npm ERR! code EPERM
npm ERR! syscall open
npm ERR! path D:\Program Files (x86)\nodejs\node_cache\_cacache\tmp\367f5c9c
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, open 'D:\Program Files (x86)\nodejs\node_cache\_cacache\tmp\367f5c9c'
npm ERR! [Error: EPERM: operation not permitted, open 'D:\Program Files (x86)\nodejs\node_cache\_cacache\tmp\367f5c9c'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'open',
npm ERR! path: 'D:\\Program Files (x86)\\nodejs\\node_cache\\_cacache\\tmp\\367f5c9c'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
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! Log files were not written due to an error writing to the directory: D:\Program Files (x86)\nodejs\node_cache\_logs
npm ERR! You can rerun the command with `--loglevel=verbose` to see the logs in your terminal
2、图片详情
二、解决方案
注意:看图中报错提示
[Error: EPERM: operation not permitted, open ‘D:\Program Files (x86)\nodejs\node_cache_cacache\tmp\367f5c9c’]
说明这个文件夹权限不足,由此解决方案如下: