Npm Please try using this command again as root/administrator

后端 未结 30 813
旧巷少年郎
旧巷少年郎 2020-12-02 06:38

I\'ve been desperately trying to install modules using node.js but it always fails getting packages with npm.

I logged in as Administrator and used powershell/cmd wi

30条回答
  •  [愿得一人]
    2020-12-02 06:52

    WHAT WORKED FOR ME

    I ran Command Prompt as Administrator. This helped partially - as I no longer got the error, "Please try using this command again as root/administrator". I was trying to install Cordova. To do it successfully, I also had to do the following:

    (1) "npm update node", plus...

    (2) I also added the " -g " in the >>npm install cordova<<. In other words, type this: >>npm install -g cordova<<

    ~~~ FOR WINDOWS 8.1 ~~~

    "RUN AS ADMINISTRATOR" COMMAND PROMPT

    For windows 8.1, I don't have an ACCESSORIES group when I click START > ALL PROGRAMS. But I do have that older -- but trusty and reliable -- START BUTTON and START MENU - thanks to the free Classic Start Menu app. So, with that installed....

    ALTERNATIVE #1:

    1. Type "cmd" in the SEARCH BOX at the bottom of the START menu.  
    2. When cmd.exe shows up in the top of the search results, right click it and select RUN AS ADMINISTRATOR.
    

    ALTERNATIVE #2 If you already have a Command Prompt window open and running - and you want to open another one to Run As Administrator:

    1. Locate the Command Prompt app icon in the Taskbar (usually along the bottom of you screen unless you have moved it a different dock/location).
    2. Right click the app icon.
    3. Now, right click "COMMAND PROMPT" and select RUN AS ADMINISTRATOR. 
    

    Hope this helps someone.

提交回复
热议问题