Set up NodeJs in global path in Ubuntu with simple steps

danyson

Danyson

Posted on August 5, 2021

Set up NodeJs in global path in Ubuntu with simple steps

Step 1 :

Note : NodeJS v14 stable

sudo snap install node --classic
Enter fullscreen mode Exit fullscreen mode

Step 2 :

Configure npm to use the ~/.npm-global directory for global module:

mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.profile
source ~/.profile
Enter fullscreen mode Exit fullscreen mode

Step 3 :

Update npm :

sudo npm install npm --global
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
danyson
Danyson

Posted on August 5, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related