mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-29 17:07:22 +00:00
126 lines
3.2 KiB
Markdown
126 lines
3.2 KiB
Markdown
---
|
|
title: 'Installation'
|
|
description: 'Get started with Nuxt quickly with our online starters or start locally with your terminal.'
|
|
navigation.icon: i-ph-play-duotone
|
|
---
|
|
|
|
## Play Online
|
|
|
|
You can start playing with Nuxt 3 in your browser using our online sandboxes:
|
|
|
|
::card-group
|
|
:card{title="Open on StackBlitz" icon="i-simple-icons-stackblitz" to="https://nuxt.new/s/v3" target="_blank"}
|
|
:card{title="Open on CodeSandbox" icon="i-simple-icons-codesandbox" to="https://nuxt.new/c/v3" target="_blank"}
|
|
::
|
|
|
|
Start with one of our starters and themes directly by opening [nuxt.new](https://nuxt.new).
|
|
|
|
## New Project
|
|
|
|
<!-- TODO: need to fix upstream in nuxt/nuxt.com -->
|
|
<!-- markdownlint-disable-next-line MD001 -->
|
|
#### Prerequisites
|
|
|
|
- **Node.js** - [`v18.0.0`](https://nodejs.org/en) or newer
|
|
- **Text editor** - We recommend [Visual Studio Code](https://code.visualstudio.com/) with the [Volar Extension](https://marketplace.visualstudio.com/items?itemName=Vue.volar)
|
|
- **Terminal** - In order to run Nuxt commands
|
|
|
|
::callout
|
|
::details
|
|
:summary[Additional notes for an optimal setup:]
|
|
- **Node.js**: Make sure to use an even numbered version (18, 20, etc)
|
|
- **Nuxtr**: Install the community-developed [Nuxtr extension](https://marketplace.visualstudio.com/items?itemName=Nuxtr.nuxtr-vscode)
|
|
- **Volar**: Either enable [**Take Over Mode**](https://vuejs.org/guide/typescript/overview.html#volar-takeover-mode) (recommended) or add the [TypeScript Vue Plugin](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin)
|
|
|
|
If you have enabled **Take Over Mode** or installed the **TypeScript Vue Plugin (Volar)**, you can disable generating the shim for `*.vue` files in your [`nuxt.config.ts`](/docs/guide/directory-structure/nuxt.config) file:
|
|
|
|
```ts [nuxt.config.ts]
|
|
export default defineNuxtConfig({
|
|
typescript: {
|
|
shim: false
|
|
}
|
|
})
|
|
```
|
|
::
|
|
::
|
|
|
|
Open a terminal (if you're using [Visual Studio Code](https://code.visualstudio.com), you can open an [integrated terminal](https://code.visualstudio.com/docs/editor/integrated-terminal)) and use the following command to create a new starter project:
|
|
|
|
::code-group
|
|
|
|
```bash [npx]
|
|
npx nuxi@latest init <project-name>
|
|
```
|
|
|
|
```bash [pnpm]
|
|
pnpm dlx nuxi@latest init <project-name>
|
|
```
|
|
|
|
```bash [bun]
|
|
bunx nuxi@latest init <project-name>
|
|
```
|
|
|
|
::
|
|
|
|
Open your project folder in Visual Studio Code:
|
|
|
|
```bash [Terminal]
|
|
code <project-name>
|
|
```
|
|
|
|
Install the dependencies:
|
|
|
|
::code-group
|
|
|
|
```bash [yarn]
|
|
yarn install
|
|
```
|
|
|
|
```bash [npm]
|
|
npm install
|
|
```
|
|
|
|
```bash [pnpm]
|
|
# Make sure you have `shamefully-hoist=true` in `.npmrc` before running pnpm install
|
|
pnpm install
|
|
```
|
|
|
|
```bash [bun]
|
|
bun install
|
|
```
|
|
|
|
::
|
|
|
|
## Development Server
|
|
|
|
Now you'll be able to start your Nuxt app in development mode:
|
|
|
|
::code-group
|
|
|
|
```bash [yarn]
|
|
yarn dev -o
|
|
```
|
|
|
|
```bash [npm]
|
|
npm run dev -- -o
|
|
```
|
|
|
|
```bash [pnpm]
|
|
pnpm dev -o
|
|
```
|
|
|
|
```bash [bun]
|
|
bun run dev -o
|
|
```
|
|
::
|
|
|
|
::callout{icon="i-ph-check-circle-duotone"}
|
|
Well done! A browser window should automatically open for <http://localhost:3000>.
|
|
::
|
|
|
|
## Next Steps
|
|
|
|
Now that you've created your Nuxt 3 project, you are ready to start building your application.
|
|
|
|
:read-more{title="Nuxt Concepts" to="/docs/guide/concepts"}
|