What is Nuxt and How to Install it on Windows?

Nuxt is a lightweight Javascript Framework of Vuejs, keep in mind that Vuejs is also a framework of javascript, and Nuxt is a framework of the framework. Nuxt simplifies the development of a universal and (SPA) single-page application. Easy setup with zero configuration.

If you would like to know what is a universal app, it can be described like this, the javascript code runs on the client side and server side as well, and VUE.js normally use for building single-page applications.

During development with Nuxt js, you can get a lot of great features like the configuration of SEO(Search Engine Optimization) meta tags method, asynchronous data, middleware, and auto-generated routing, automatic code-splitting.

If you are an HTML coder and building the HTML front end, then it is the best option to use the Nuxt and generate HTML for a server because you can generate static HTML sites faster than normally write the code in HTML.

Install Nuxt.js on Windows

Nuxt is very simple to install on the local server, follow the steps. Nuxt can be installed manually and using NPX to choose a few options.

Before installation, you need to install the latest version of Node. and obviously, you will need a code editor to write the code and terminal, I will recommend using the VS (visual studio) which also has a built-in terminal.

Nuxt installation by using create-nuxt-app to get started quickly.

npx create-nuxt-app <your-project-name>

It will ask a few questions like

  • Product name
  • Nuxt options
  • UI framework
  • TypeScript
  • Linter
  • Testing Framework

Once all questions are answered it will install all of the dependencies to your project. Once installation is complete you need to run the project.

First, go inside your project directory by using terminal

cd <your-project-name>

Now run enter the command

npm run dev

The server will run and you need to go to the browser and type in URL bar

localhost:3000

Manually Installation of Nuxt.js

Just create a directory where you want to keep the project then go inside the directory and create a package.json.

We need to put some basic information in the JSON file

{
  "name": "my-app",
  "scripts": {
    "dev": "nuxt",
    "build": "nuxt build",
    "generate": "nuxt generate",
    "start": "nuxt start"
  }
}

The name will be changed to your project name and the rest of the information keep the same in the terminal and run the following command

npm install nuxt

This command will add Nuxt as a dependency to your project and add it in the package.json file also will create a node_module directory which is where all your installed packages and dependencies are stored.

After installation of Nuxt create a page directory and create a file with index.vue this file will be your landing page. Copy template for testing and see on the browser.

<template>
  <h1>Hello world!</h1>
</template>

Now start your project goto terminal and type,

npm run dev

You will see the “Hello World” on the landing page.