Fixing npm path in Windows 8 and 10

前端 未结 18 1860
孤街浪徒
孤街浪徒 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:51

    If after installing your npm successfully, and you want to install VueJS then this is what you should do

    after running the following command (as Admin)

    npm install --global vue-cli

    It will place the vue.cmd in the following directory C:\Users\YourUserName\AppData\Roaming\npm

    you will see this in your directory.

    Now to use vue as a command in cmd. Open the cmd as admin and run the following command.

    setx /M path "%path%;%appdata%\npm"

    Now restart the cmd and run the vue again. It should work just fine, and then you can begin to develop with VueJS.

    I hope this helps.

提交回复
热议问题