Fixing npm path in Windows 8 and 10

前端 未结 18 1602
孤街浪徒
孤街浪徒 2020-11-22 15:30

Have done a lot of googling, tried reinstalling node.js using the official installer, but my npm pathing still doesn\'t work.

This doesn\'t work

npm          


        
18条回答
  •  醉酒成梦
    2020-11-22 15:48

    Installed Node Version Manager (NVM) for Windows: https://github.com/coreybutler/nvm-windows

    I'm using Windows 10 - 64 bit so I run... Commands:

    • nvm arch 64 (to make default the 64 bit executable)
    • nvm list (to list all available node versions)
    • nvm install 8.0.0 (to download node version 8.0.0 - you can pick any)
    • nvm use 8.0.0 (to use that specific version)

    In my case I had to just switch to version 8.5.0 and then switch back again to 8.0.0 and it was fixed. Apparently NVM sets the PATH variables whenever you do that switch.

提交回复
热议问题