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,成功

转载于:https://www.cnblogs.com/steamed-twisted-roll/p/11151731.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值