Hi all! So pretty new to DigitalOcean, and am wanting to get the MEAN stack tools installed on my droplet.
I got npm installed easily and can get npm -v However node -v and node didn’t work.
So I followed the instructions here: https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-an-ubuntu-14-04-server
Followed these steps:
sudo apt-get update
sudo apt-get install nodejs
And got the follow:
root@Bitage:~# sudo apt-get install nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
nodejs is already the newest version.
nodejs set to manually installed.
The following packages were automatically installed and are no longer required:
linux-headers-3.13.0-36 linux-headers-3.13.0-36-generic
linux-image-3.13.0-36-generic linux-image-extra-3.13.0-36-generic
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 70 not upgraded.
root@Bitage:~# sudo apt-get install npm
Reading package lists... Done
Building dependency tree
Reading state information... Done
npm is already the newest version.
The following packages were automatically installed and are no longer required:
linux-headers-3.13.0-36 linux-headers-3.13.0-36-generic
linux-image-3.13.0-36-generic linux-image-extra-3.13.0-36-generic
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 70 not upgraded.
root@Bitage:~# node -v
root@Bitage:~# node
root@Bitage:~#
I’m still not getting the node version, and also typing node doesn’t open the REPL?
What am I doing wrong?
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 recognize now I jumped the gun on recommending n as it has some issues in shared node_modules across versions (uninstalling is also painful). I’ve since tried n, nodenv, nvm & nave for managing versions and nodenv is the best while nvm and nave are worth considering. You can review my article for using nodenv to manage virtual environments in development. I’m going to next write one for using nodenv in facilitation production deployments but perhaps in the interim this can provide some inspiration.
This is an old question but I stumbled upon and thought I would add a few things. Ubuntu 14.04 & 16.04 package repos include a stable but older version of node. If you want a newer, faster version you can install node.js via n
First install node package manager, then install n globally
sudo apt install npm
sudo npm install -g n
You can then install & activate the latest stable version of node:
sudo n latest
Or you can install the latest LTS version. Check here for the [LTS schedule] (https://github.com/nodejs/LTS#lts-schedule) or here for a [version list] (https://nodejs.org/en/download/releases/).
So as of today Boron is most recent LTS at version 6.10.0, I could install this as:
sudo n 6.10.0
You can then check version and install location:
$ node -v
v6.10.0
$ which node
/usr/local/bin/node
Besides n there is also nvm for version management. Yes the node ecosystem can be confusing but eventually it makes sense.
The nodejs package installs node as nodejs, so running nodejs -v should work. If you’re not planning on install the node package which is completely unrelated to NodeJS, you can link node to nodejs:
sudo ln -s /usr/bin/nodejs /usr/bin/node
You should then be able to use node as well as nodejs.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
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.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.