How to Install and Creating First Nuxt.js App ?
What is NuxtJS?
NuxtJS is a VueJS framework for creating web apps. It makes development more fast, easy, and organized. NuxtJS is similar to Next.js, which is a framework of React.js.
The main features of NuxtJS are:
- Great folder structure: Nuxt App comes with a great folder structure that makes development fast and organized.
- Server-Side Rendering (SSR): Easily render react components on the server before sending HTML to the client.
- Statical Rendering: Auto generates routes on file or folder creation.
- Code Splitting: Create a static version of the web app with a special Webpack configuration.
Prerequisites: Following are some pre-requisites to create a Nuxt app.
- Node (version 10.13 or above) installed.
- Basic knowledge of NPM (Node Package Manager).
Steps to create and run the nuxt app:
Step 1: Now create a folder for your project on the desktop and navigate to the folder through your terminal.
Step 2: Run the following command in the terminal. The my-app is the name of our app, you can give any name of your choice.
npx create-nuxt-app my-app
Folder structure: It will look like this.
Step 3: After that, you have to answer some questions in terminal answer those according to your choice.
Step 4: Now navigate to your app using the following command:
Step 5: Run your app using the following command.
npm run dev
Output: Now open your browser and go to http://localhost:3000/, you will see the following output: