When I reinstall the computer system, I download the front-end environment configuration again. An error occurs when configuring NPM. The main error messages are as follows:
npm WARN logfile could not create logs-dir: Error: EPERM: operation not permitted, mkdir 'E:\work\node\node_cache\_logs'
npm WARN logfile could not be created: Error: ENOENT: no such file or directory, open 'E:\work\node\node_cache\_logs\2022-08-24T09_17_13_819Z-debug-0.log'
npm WARN logfile could not create logs-dir: Error: EPERM: operation not permitted, mkdir 'E:\work\node\node_cache\_logs'
npm WARN logfile could not be created: Error: ENOENT: no such file or directory, open 'E:\work\node\node_cache\_logs\2022-08-24T09_17_14_514Z-debug-0.log'
npm ERR! code EPERM
npm ERR! syscall mkdir
npm ERR! path E:\work\node\node_cache\_cacache
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, mkdir 'E:\work\node\node_cache\_cacache'
npm ERR! [Error: EPERM: operation not permitted, mkdir 'E:\work\node\node_cache\_cacache'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'mkdir',
npm ERR! path: 'E:\\work\\node\\node_cache\\_cacache'
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: E:\work\node\node_cache\_logs
npm ERR! You can rerun the command with `--loglevel=verbose` to see the logs in your terminal
First, check whether the parameters of system environment configuration and user environment configuration are consistent
Click the path in the system environment configuration to observe whether the path is consistent. This may be my personal reason. After reinstalling node several times, the path here is inconsistent. After the change, it is still not possible.
I thought it was caused by the command line permission problem, and found that using the administrator still does not work, and then I searched the Internet for the reason and finally found it;
- Find the .npmrc file under C:\Users\{account}\ and delete it
- After clearing npm cache:npm cache clean –force
- Then run the npm install command.
Read More:
- How to Solve Vue add element Install Error
- VUE: How to Solve NPM Always Install Error
- How to Solve NPM installation -g @view/client Error
- How to Solve Vue-devtool Package Error
- How to Solve Nodejs error: cannot find module ‘. /application’
- [Solved] Vue create Create Project Error: command failed: npm install –loglevel error
- [Chrome]: DevTools failed to load source map… (How to Solve)
- How to Solve Vue loading 3D model Error
- [Solved] “npm WARN logfile could not be created: Error: EPERM: operation not permitted,…”
- How to Solve Node start error listen eacces 0.0.0.0:810
- How to Solve Vite package error
- How to Solve MAC electronic installation dependent startup error
- [Solved] Vue create error: ERROR: command failed: npm install –loglevel error
- How to Solve React devtools plug-in Error
- How to Solve QT uses MSVC compiler to code error
- Vue: How to Solve Eslint error
- How to Solve Vue cli configuration SCSS global variable error
- How to Solve Vue project Startup Error (Node Upgrade issue)
- How to Solve electron import page Error
- How to Solve pinia Error in ts File