![]() |
VOOZH | about |
Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.
Node.js is a JavaScript platform for general-purpose programming that allows users to build network applications quickly. By leveraging JavaScript on both the front and backend, Node.js makes development more consistent and integrated.
To get your development environment configured so you can start building Node.js applications. select the tutorial for your platform.
Browse Series: 9 tutorials
Senior Technical Writer at DigitalOcean
I help Businesses scale with AI x SEO x (authentic) Content that revives traffic and keeps leads flowing | 3,000,000+ Average monthly readers on Medium | Sr Technical Writer(Team Lead) @ DigitalOcean | Ex-Cloud Consultant @ AMEX | Ex-Site Reliability Engineer(DevOps)@Nutanix
With over 6 years of experience in tech publishing, Mani has edited and published more than 75 books covering a wide range of data science topics. Known for his strong attention to detail and technical knowledge, Mani specializes in creating clear, concise, and easy-to-understand content tailored for developers.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
I really appreciated the 3 options you gave us. I wonder though… I went with NVM and copied the code snippets to install it. Should I have used sudo with these commands. It appears that nvm was installed but only for my sudo user. I’m hoping (and guessing) this won’t be an issue. Thanks you!
If you want the nvm node version to be the default, ie stay set after reboot run this. $ nvm alias default <your version>
When following “Option 3 — Installing Node Using the Node Version Manager” you will be unable to “sudo npm”.
This can be fixed by running this command:
n=$(which node);n=${n%/bin/node}; chmod -R 755 $n/bin/*; sudo cp -r $n/{bin,lib,share} /usr/local
From here.
If you go with option 1 or 2, you will probably face permission error issues.
In this case, make sure to configure npm to use a different directory.
Thanks Brian. This doc is very clear and complete and helped me a great deal.
If you’re using Option 2, you need to run sudo apt update after you’ve added the PPA to your configuration, otherwise you’ll get an error message about being Unable to locate package node.js…
In the version of this tutorial for ubuntu 18.04, there are instructions for installing the build essentials package, but not here. This is not required for this version?
If you’re using a non root user and having issues like this: “E: Failed to fetch http://mirrors.digitalocean.com/ubuntu focal InRelease” Try the command “sudo apt-get update”. If you have problem also with this command then you have to change the fetch link that gives you the error.
Try these commands:
If you type “ls” you should see a “sources.list” file. We need to edit that.
Type: “vim sources.list”
Activate editor by pressing “i” then move to every link that has “mirrors.digitalocean.com” and change it to “archive.ubuntu.com”.
When you finish, press “esc” then “:w !sudo tee % > /dev/null”. File should be saved now.
Try installing nodejs now. Should work fine.
Hope it helps.
node -v node: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27’ not found (required by node)
This helped thanks!
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.