Environment configuration for global installation of @vue/cli scaffolding

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 errorPlease add a picture description

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 binto view the global package path (the path must be configured in the environment variable later). insert image description here
This directory is about the vue command
insert image description here
. Next, open the computer settings, search for the advanced system settings,
insert image description here
find the path in the system variable, double-click to open it
insert image description here
, then write in the global package path that you viewed before, and then confirm and confirm. After reopening the console, enter, and the vue -Vrelevant version number will appear!
insert image description here
insert image description here

Guess you like

Origin blog.csdn.net/m0_57524265/article/details/129639346