vue-cli3.x创建项目vue create hello-world
在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,成功