Installation

    To get started quickly, the Nuxt.js team has created scaffolding tool create-nuxt-app.

    Make sure you have installed (npx is shipped by default since NPM 5.2.0)

    Or with yarn:

    1. $ yarn create nuxt-app <project-name>

    It will ask you some questions:

    • Choose between integrated server-side frameworks:
    • Choose your favorite testing framework:
      • None (feel free to add one later)
      • Jest
    • The Nuxt mode you want (Universal or SPA)
    • Add to Lint your code on save.
    • Add Prettier to prettify your code on save. When answered, it will install all the dependencies so the next step is to navigate to the project folder and launch it with:
    1. $ cd <project-name>
    2. $ npm run dev

    The application is now running on .

    To discover more about the directory structure of the project: Directory Structure Documentation.

    Starting from scratch

    Creating a Nuxt.js project from scratch is easy, only 1 file and 1 directory are required. Create an empty directory to start:

    Info: replace <project-name> with a name for the project.

    Every project needs a file to start nuxt. Copy this json into your package.json and save before running npm install (below):

    1. {
    2. "name": "my-app",
    3. "scripts": {
    4. "dev": "nuxt"
    5. }
    6. }

    scripts will launch Nuxt.js via npm run dev.

    1. $ npm install --save nuxt

    Nuxt.js transforms every *.vue file inside a pages directory as a route for the application.

    Create the pages directory:

    then create the first page in pages/index.vue:

    1. <template>
    2. <h1>Hello world!</h1>
    3. </template>

    and launch the project with:

    The application is now running on http://localhost:3000.

    To discover more about the directory structure of the project: .