npm hangs on any command

后端 未结 6 1099
庸人自扰
庸人自扰 2021-01-01 20:01

I installed last version of Node.js (12.2 x64 windows) After I run cmd as administrator and try to call any npm command (except npm -v

6条回答
  •  孤城傲影
    2021-01-01 20:34

    It happenned for me too : I installed node only for my user on Windows 10, and managed to use npm by calling it using the full path "c:\Program Files\nodejs\npm"

    I solved by using "c:\Program Files\nodejs\npm" config set prefix "c:\Program Files\nodejs" (setting the prefix to the full path to npm)

    And the result was :

        λ cat c:\Users\\.npmrc
        prefix=c:\Program Files\nodejs
    

    Now eveything works fine.

提交回复
热议问题