在git中輸入指令vue create hello-world,沒反應,因為vue-cli的版本問題,必須3.x版本才能使用這個指令於是按照官網的提示升級vue
vue-cli從2.x版本升級到3.x版本卸載包報錯.
根據官網的指令輸入: yarn global remove vue-cli
報錯:
error This module isn't specified in a package.json file.
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.
改用npm uninstall vue-cli -g卸載就成功了
vue --version
bash: /c/Users/lsm/AppData/Roaming/npm/vue: No such file or directory
重新安裝后
$ vue --version
3.9.2
再次輸入指令:
vue create my-tetris
? Please pick a preset: (Use arrow keys)
? Please pick a preset: default (babel, eslint)
? Pick the package manager to use when installing dependencies: (Use arrow keys)
? Pick the package manager to use when installing dependencies: Yarn
- Creating project in D:\gitProject\my-tetris.
✨ Creating project in D:\gitProject\my-tetris.
- Initializing git repository...
🗃 Initializing git repository...
⚙ Installing CLI plugins. This might take a while...
yarn install v1.15.2
OK,成功