实例

npm ERR! code EPERM
npm ERR! syscall unlink
npm ERR! path D:\1000software\1100productivity\node\node_cache\_cacache\tmp\442012ad
npm ERR! errno EPERM
npm ERR! FetchError: Invalid response body while trying to fetch https://registry.npmjs.org/create-vite: EPERM: operation not permitted, unlink 'D:\1000software\1100productivity\node\node_cache\_cacache\tmp\442012ad'
npm ERR!     at D:\1000software\1100productivity\node\node_global\node_modules\npm\node_modules\minipass-fetch\lib\body.js:170:15
npm ERR!     at async Response.json (D:\1000software\1100productivity\node\node_global\node_modules\npm\node_modules\minipass-fetch\lib\body.js:75:17)
npm ERR!     at async RegistryFetcher.packument (D:\1000software\1100productivity\node\node_global\node_modules\npm\node_modules\pacote\lib\registry.js:94:25)
npm ERR!     at async RegistryFetcher.manifest (D:\1000software\1100productivity\node\node_global\node_modules\npm\node_modules\pacote\lib\registry.js:118:23)
npm ERR!     at async getManifest (D:\1000software\1100productivity\node\node_global\node_modules\npm\node_modules\libnpmexec\lib\index.js:30:22)   
npm ERR!     at async missingFromTree (D:\1000software\1100productivity\node\node_global\node_modules\npm\node_modules\libnpmexec\lib\index.js:64:22)
npm ERR!     at async D:\1000software\1100productivity\node\node_global\node_modules\npm\node_modules\libnpmexec\lib\index.js:168:32
npm ERR!     at async Promise.all (index 0)
npm ERR!     at async exec (D:\1000software\1100productivity\node\node_global\node_modules\npm\node_modules\libnpmexec\lib\index.js:166:3)
npm ERR!     at async Init.execCreate (D:\1000software\1100productivity\node\node_global\node_modules\npm\lib\commands\init.js:134:5)
npm ERR!  FetchError: Invalid response body while trying to fetch https://registry.npmjs.org/create-vite: EPERM: operation not permitted, unlink 'D:\1000software\1100productivity\node\node_cache\_cacache\tmp\442012ad'
npm ERR!     at D:\1000software\1100productivity\node\node_global\node_modules\npm\node_modules\minipass-fetch\lib\body.js:170:15
npm ERR!     at async Response.json (D:\1000software\1100productivity\node\node_global\node_modules\npm\node_modules\minipass-fetch\lib\body.js:75:17)
npm ERR!     at async RegistryFetcher.packument (D:\1000software\1100productivity\node\node_global\node_modules\npm\node_modules\pacote\lib\registry.js:94:25)
npm ERR!     at async RegistryFetcher.manifest (D:\1000software\1100productivity\node\node_global\node_modules\npm\node_modules\pacote\lib\registry.js:118:23)
npm ERR!     at async getManifest (D:\1000software\1100productivity\node\node_global\node_modules\npm\node_modules\libnpmexec\lib\index.js:30:22)   
npm ERR!     at async missingFromTree (D:\1000software\1100productivity\node\node_global\node_modules\npm\node_modules\libnpmexec\lib\index.js:64:22)
npm ERR!     at async D:\1000software\1100productivity\node\node_global\node_modules\npm\node_modules\libnpmexec\lib\index.js:168:32
npm ERR!     at async Promise.all (index 0)
npm ERR!     at async exec (D:\1000software\1100productivity\node\node_global\node_modules\npm\node_modules\libnpmexec\lib\index.js:166:3)
npm ERR!     at async Init.execCreate (D:\1000software\1100productivity\node\node_global\node_modules\npm\lib\commands\init.js:134:5) {
npm ERR!   code: 'EPERM',
npm ERR!   errno: 'EPERM',
npm ERR!   syscall: 'unlink',
npm ERR!   path: 'D:\\1000software\\1100productivity\\node\\node_cache\\_cacache\\tmp\\442012ad',
npm ERR!   type: 'system'
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! Log files were not written due to an error writing to the directory: D:\1000software\1100productivity\node\node_cache\_logs
npm ERR! You can rerun the command with `--loglevel=verbose` to see the logs in your terminal

原因分析

解决方案