One: cli installation:
The default is to install in the following directory:
C:\ Users\xiaocj\AppData\Roaming\npm\node_modules\@vue
Add environment variable: NODE_PATH C:\Program Files\nodejs\node_modules
npm config set cache “C:\Program Files\nodejs\node_cache” //—Here is my customized cache path, it doesn’t matter
C:\Users\xiaocj\AppData\Roaming\npm
cnpm uninstall -g vue-cli
cnpm install -g @vue/cli
The default is to install in the following directory:
C:\Users\xiaocj\AppData\Roaming\npm\node_modules \@vue
If you want to change the installation path, then:
Edit Path Add Node.js installation path Such as: C:\Program Files\nodejs
Add environment variable: NODE_PATH C:\Program Files\nodejs\node_modules
npm config set prefix “C:\Program Files\nodejs” //The path here must correspond to the path above!
npm config set cache “C:\Program Files\nodejs\node_cache” //—Here is my customized cache path, it doesn’t matter
Open the environment variable> in the user Find the path in the variable. The path here must correspond to the global installation path of your computer npm
C:\Users\xiaocj\AppData\Roaming\npm
Pass vue -V or vue –version Check the version of vue/cli
Uninstall cli
cnpm uninstall -g vue-cli
Two: https://www.jianshu.com /p/2125aa097727