npm ERR! Error: EPERM: operation not permitted, rename
Problem background: Recently, there was a problem with the packaging of the project. I thought it was caused by the node version problem, so I tossed and switched several versions, which led to the problem of NPM
- when NPM is installed, the following error is reported (the picture refers to someone else’s, infringed or deleted). There are many reasons for this error. The specific reason is that the node version and windows version are intertwined, which makes it impossible to find out exactly (I hope some big guys can find it)
in addition, the time when this problem occurs is also different, some are during installation, Some are during run dev, and some are during packaging.
after encountering problems, the first is a variety of search solutions. The commonly used solutions are probably the following: OL>
Run CMD as administrator
Because the system prompts that the permission is not enough, I am now an ordinary user. Then I run as an administrator. The idea is feasible
see: https://blog.csdn.net/Running_ Fe/article/details/81629330
Delete the. Npmrc file in the user directory
This scheme can solve some problems to a certain extent
Clear cache + reinstall: NPM clear cache — force, NPM install
see: https://www.cnblogs.com/maycpou/p/12080814.html
Delete the file mentioned in the error message
Some people say that this solution can solve the problem, but I can’t find the file
see: https://blog.csdn.net/LJJONESEED/article/details/119926728
Close all editors that reference the current project
Because his error message says “the current file may be open in another editor”, close the editor, clear the cache, and then reload
Finally, a post in stack overflow is attached. The discussion below this post is very intense. There are many schemes. If you are interested, you can look
see: https://stackoverflow.com/questions/39293636/npm-err-error-eperm-operation-not-permitted-rename#
Please note that
I hope some big guys can give the real reason for this problem and hold their fists