2023-11-14 12:07PM
1. 查看你的 vue 版本:
$ vue --version
2.9.6
2. 你需要先使用 --force 来覆盖已存在的文件。
$ npm install -g @vue/cli --force
3. 检查你的 Node.js 版本
$ node --version
v21.1.0
4. 重新安装 Vue CLI
$ npm install -g @vue/cli
5. 然后在重新检查你的 vue 版本
$ vue --version
@vue/cli 5.0.8
6. 创建 vue3 项目
$ vue create my_project
就会自动创建:
(node:1847812) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
? Your connection to the default yarn registry seems to be slow.
Use https://registry.npmmirror.com for faster installation? Yes
Vue CLI v5.0.8
? Please pick a preset: Default ([Vue 3] babel, eslint)
? Pick the package manager to use when installing dependencies: NPM
Vue CLI v5.0.8
✨ Creating project in /home/meiyi/workspace/my_project.
🗃 Initializing git repository...
⚙️ Installing CLI plugins. This might take a while...
added 869 packages in 18s
🚀 Invoking generators...
📦 Installing additional dependencies...
added 103 packages in 4s
⚓ Running completion hooks...
📄 Generating README.md...
🎉 Successfully created project my_project.
👉 Get started with the following commands:
$ cd my_project
$ npm run serve
然后进入项目
cd my_project
然后启动项目
npm run serve
就发现可以了
登录
请登录后再发表评论。
评论列表:
目前还没有人发表评论