DEV Community

Danyson
Danyson

Posted on

6 2

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

Top comments (0)

Image of Quadratic

Free AI chart generator

Upload data, describe your vision, and get Python-powered, AI-generated charts instantly.

Try Quadratic free

👋 Kindness is contagious

Dive into this thoughtful article, cherished within the supportive DEV Community. Coders of every background are encouraged to share and grow our collective expertise.

A genuine "thank you" can brighten someone’s day—drop your appreciation in the comments below!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found value here? A quick thank you to the author makes a big difference.

Okay