Vue installed but not available

install vue

Open cmd as an administrator, enter the command line to install vue

npm install -g @vue/cli

After installation, enter the command to view the version Note: -V is uppercase

vue -V

But when I checked the vue version, I found an error ""vue -V is not recognized as an internal or external command, nor is it a runnable program or batch file"

solve

First check, where the file is installed on the computer, continue to enter the following command in cmd to view

npm config ls

Your installation path and temporary storage path will be displayed.
insert image description here
I found that the path I installed is repeated, and the installed vue and npm are not in the same path.
insert image description here
insert image description here

method one:

The easiest way here is to copy the @vue folder to the same level as npm, delete the node_modules folder at the same level as npm, and then copy the three files vue, vue.cmd, and vue. Copy it to ps1, at the same level as node_modules (if yours is in other paths, you can also copy it directly, if it fails, you can try the second method below, directly modify the installation path) Finally, enter
insert image description here
insert image description here
vue -V in cmd, it will be fine
insert image description here

Method Two:

You can also modify the npm download path, method:
here I am changing it according to my path (you have to find the exact path for yourself, don’t make a mistake)

npm config set prefix = "C:\\Program Files\\nodejs"

Restart cmd, then check whether the modification is correct
insert image description here
and then install it.

Guess you like

Origin blog.csdn.net/weixin_44042442/article/details/123987189