Npm Please try using this command again as root/administrator

后端 未结 30 827
旧巷少年郎
旧巷少年郎 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 07:08

    Here is how I fixed this on my Windows (7) Dev. environment. I assume the following...

    • You are Running Command Prompt, Git Bash, Cmder or your favorite Terminal, as an Administrator by right clicking
    • Privileges Permissions have been granted for Read/Write (i.e chmod -777)

    Okay, let's get to it:

    1. Update any packages where a version check is returning a warning ("npm WARN"..) for example...

      npm update -g npm

      npm update -g graceful-fs

    2. Next we want to force a cache clean. This is flagged by an '--f' or '-f'..

      npm cache clean --f

    3. In Widows Explorer search for the following path

    %APPDATA%\npm-cache

    And Delete it's contents

    1. Start a fresh instance of your Terminal, remembering to 'Right-Click' and 'Run as Administrator', install the packages again.

    Hope this helps someone!!

提交回复
热议问题