vue脚手架4.0 兼容 2.0搭建

cmd  最好用管理员

第一步查看vue版本
vue -V

第二部 卸载版本
npm uninstall vue-cli -g

第三部安装最新版本
cnpm install -g @vue/cli

第四步按装兼容vue-cl2的版本
cnpm install -g @vue/cli-init

vue init 的运行效果将会跟 vue-cli@2.x 相同

Users\Desktop>vue create demo40
? Your connection to the default yarn registry seems to be slow.
Use https://registry.npm.taobao.org for faster installation? Yes

Vue CLI v4.4.6
? Please pick a preset: default (babel, eslint)
? Pick the package manager to use when installing dependencies: Yarn

Vue CLI v4.4.6
✨ Creating project in C:\Users\Desktop\demo40.
🗃 Initializing git repository…
⚙️ Installing CLI plugins. This might take a while…

yarn install v1.22.4
info No lockfile found.
[1/4] Resolving packages…
[2/4] Fetching packages…
info fsevents@2.1.3: The platform “win32” is incompatible with this module.
info “fsevents@2.1.3” is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.2.13: The platform “win32” is incompatible with this module.
info “fsevents@1.2.13” is an optional dependency and failed compatibility check. Excluding it from installation.
success Saved lockfile.
Done in 113.31s.
🚀 Invoking generators…
📦 Installing additional dependencies…

yarn install v1.22.4
[1/4] Resolving packages…
[2/4] Fetching packages…
info fsevents@2.1.3: The platform “win32” is incompatible with this module.
info “fsevents@2.1.3” is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.2.13: The platform “win32” is incompatible with this module.
info “fsevents@1.2.13” is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies…
[4/4] Building fresh packages…
success Saved lockfile.
Done in 29.22s.
⚓ Running completion hooks…

📄 Generating README.md…

🎉 Successfully created project demo40.
👉 Get started with the following commands:

$ cd demo40
$ yarn serve

C:\Users\Desktop
C:\Users\Desktop>cd demo40

C:\Users\Desktop\demo40>npm run serve

demo40@0.1.0 serve C:\Users\Desktop\demo40
vue-cli-service serve

INFO Starting development server…
98% after emitting CopyPlugin

DONE Compiled successfully in 5706ms 17:05:23

App running at:

  • Local: http://localhost:8080/
  • Network: http:本地主机地址

Note that the development build is not optimized.
To create a production build, run yarn build.

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值