执行npm create nuxt-app命令默认安装Nuxt 2时,如何安装Nuxt 3版本Vue应用
How to Install Nuxt 3 Using npm Commands
Ah, I get it—you're running into confusion because the create-nuxt-app package is exclusively for setting up Nuxt 2 projects. That's why no matter what version tag you add to that command, it'll still spin up a Nuxt 2 app. Nuxt 3 uses a completely different set of initialization tools, so let's fix that:
Correct Commands for Nuxt 3
1. Install the Latest Stable Nuxt 3 Version
You have two straightforward options here:
- Using Nuxt's official CLI tool
nuxi:npx nuxi init mousa - Using npm's
createshortcut (points to the officialnuxtpackage):npm create nuxt@latest mousa
2. Install a Specific Nuxt 3 Version
If you need a particular version (e.g., 3.8.0), just append the version tag to the command:
- With
nuxi:npx nuxi@3.8.0 init mousa - With npm
create:npm create nuxt@3.8.0 mousa
Post-Creation Steps
Once the project is initialized, don't forget to:
- Navigate into your project folder:
cd mousa - Install dependencies:
npm install - Start the development server:
npm run dev
A quick note: The old create-nuxt-app tool is now deprecated for Nuxt 3, so you'll want to stick to the commands above for all new Nuxt 3 projects.
内容的提问来源于stack exchange,提问作者Mohammad Ghiasvand
相关产品推荐
相关产品推荐

