1. Error message
After installing yarn global add @vue/cli
@vue/cli, enter vue -V in the console to report that it is not an internal or external command error
2. The reason for the error
The system recognition command needs to be realized by environment variables, and the global package path installed by yarn is not configured in the environment variable, so the system cannot recognize the command
3. Solutions
Just configure the global package path installed by yarn into the environment variable
4. Method steps
Enter in the console yarn global bin
to view the global package path (the path must be configured in the environment variable later).
This directory is about the vue command
. Next, open the computer settings, search for the advanced system settings,
find the path in the system variable, double-click to open it
, then write in the global package path that you viewed before, and then confirm and confirm. After reopening the console, enter, and the vue -V
relevant version number will appear!