Javascripts

How to Install Vue CLI on Ubuntu 22.04

In this article, we’ll explain how to install Vue CLI on Ubuntu 22.04.

Vue.js is an open-source model-view-viewmodel front end JavaScript framework. This article will guide you the installation process and creating hello world first project.

Prerequisites

Install Vue CLI on Ubuntu 22.04

1 – User management

Add user

# adduser <user name>

It will ask you to enter the password for the new user.

Add user in sudo group

# usermod -aG sudo block

Login with new user

# su – <username>

2 – Keep the server up to date

$ sudo apt update -y

3 – Download NodeJS

Download latest stable release of NodeJS.

$ sudo curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash –

4 – Install NodeJS

Next, install the NodeJS using following command:

$ sudo apt-get install -y nodejs

5 – Verify the installation

$ node -v && npm -v

Output:

v18.9.0
8.19.1

6. Install Vue CLI

Following command will install Vue CLI.

$ sudo npm install -g @vue/cli

Verify the installation:

$ vue –version

Output:

@vue/cli 5.0.8

7. Create Vue project

$ vue create hello-world

You will be prompted to pick a preset. You can either choose the default preset which comes with a basic Babel + ESLint setup, or select “Manually select features” to pick the features you need.

Output:

Vue CLI v5.0.8`
? Please pick a preset: (Use arrow keys)
❯ Default ([Vue 2] babel, eslint)
Default (Vue 3 Preview) ([Vue 3] babel, eslint)
Manually select features

Successfully created project hello-world.
Get started with the following commands:

$ cd hello-world
$ sudo npm run serve

Output:

App running at:
– Local: http://localhost:8080/
– Network: http://192.168.0.106:8080/

Note that the development build is not optimized.
To create a production build, run npm run build.

Navigate to your browser and open http://[server_IP]:8080.

How to Install Vue CLI on Ubuntu 22.04

That’s it. The installation has been completed.

In this article, we have seen how to install Vue CLI on Ubuntu 22.04.

Related Articles