npm can only be run as an administrator (super full version)

Otherwise, there will be

'npm' is not recognized as an internal or external command or operable program

or batch file.

If you search, you will see many solutions, which is to change the permissions of nodejs files

1. Solve

First use where node in cmd to search for the location of the nodejs file. For example, mine is under the Program Files file in the C drive.

After finding the nodejs file, right-click and select Properties, then select Security. Here we can see that only three permissions are checked. Open editing, check Full Control and confirm, and you are done.

If it still doesn't take effect, you can try to select Users here and add full control permissions to see if it takes effect.

2. Question

If some people are like me, when they click OK, it does not take effect immediately, but an annoying warning pop-up window pops up.

Then you can try the solution I found, change the owner, the link is here (18 messages) Win10 prompts "Unable to enumerate the object in the container, access is denied" The ultimate solution (I am disgusted by this thing, Ya'eryo , blog in anger)_Jedi_LK's blog-CSDN blog_Unable to enumerate objects in the container, access is denied

The method is as follows: This time in Properties-Security, select Advanced.

The author also said that if it fails, replace it with EveryOne, as shown below,

After confirming, try again and you will be able to check the permissions.

3. Ask for help

If there are still unlucky people like me who still haven't solved the problem. Even if the permissions are increased, they can only run npm as an administrator. They can even only search for the node and npm version numbers under the administrator cmd. Then it is probably a problem with the node download. . Uninstall it and re-install it, or endure the nausea and continue to use the administrator, or ask an expert to teach you how to solve it.

Guess you like

Origin blog.csdn.net/m0_56683897/article/details/128946828