You can also run this command directly using 'npm init @eslint/config'.
npm error code EPERM
npm error syscall mkdir
npm error path D:\NVM_node_v\nodejs\node_cache
npm error errno EPERM
npm error FetchError: Invalid response body while trying to fetch https://registry.npmmirror.com/@eslint%2fcreate-config: EPERM: operation not permitted, mkdir 'D:\NVM_node_v\nodejs\node_cache'
npm error at D:\NVM_node_v\nvm\v20.17.0\node_modules\npm\node_modules\minipass-fetch\lib\body.js:170:15
npm error at async Response.json (D:\NVM_node_v\nvm\v20.17.0\node_modules\npm\node_modules\minipass-fetch\lib\body.js:75:17)
npm error at async RegistryFetcher.packument (D:\NVM_node_v\nvm\v20.17.0\node_modules\npm\node_modules\pacote\lib\registry.js:98:25)
npm error at async RegistryFetcher.manifest (D:\NVM_node_v\nvm\v20.17.0\node_modules\npm\node_modules\pacote\lib\registry.js:128:23)
npm error at async getManifest (D:\NVM_node_v\nvm\v20.17.0\node_modules\npm\node_modules\libnpmexec\lib\index.js:27:22)
npm error at async missingFromTree (D:\NVM_node_v\nvm\v20.17.0\node_modules\npm\node_modules\libnpmexec\lib\index.js:60:22)
npm error at async D:\NVM_node_v\nvm\v20.17.0\node_modules\npm\node_modules\libnpmexec\lib\index.js:182:32
npm error at async Promise.all (index 0)
npm error at async exec (D:\NVM_node_v\nvm\v20.17.0\node_modules\npm\node_modules\libnpmexec\lib\index.js:180:3)
npm error at async Init.execCreate (D:\NVM_node_v\nvm\v20.17.0\node_modules\npm\lib\commands\init.js:136:5) {
npm error code: 'EPERM',
npm error errno: 'EPERM',
npm error syscall: 'mkdir',
npm error path: 'D:\\NVM_node_v\\nodejs\\node_cache',
npm error type: 'system'
npm error }
npm error
npm error The operation was rejected by your operating system.
npm error It's possible that the file was already in use (by a text editor or antivirus),
npm error or that you lack permissions to access it.
npm error
npm error If you believe this might be a permissions issue, please double-check the
npm error permissions of the file and its containing directories, or try running
npm error the command again as root/Administrator.
npm notice
npm notice New minor version of npm available! 10.8.2 -> 10.9.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.9.0
npm notice To update run: npm install -g npm@10.9.0
npm notice
npm error Log files were not written due to an error writing to the directory: D:\NVM_node_v\nodejs\node_cache\_logs
npm error You can rerun the command with `--loglevel=verbose` to see the logs in your terminal
npm notice
npm notice New minor version of npm available! 10.8.2 -> 10.9.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.9.0
npm notice To update run: npm install -g npm@10.9.0
npm notice
解决方式:
切换不同版本的nodejs,我试了node20,不行,又试了node22是可以的