How to install Node.js in Elementary OS using Terminal
Follow these steps to install Node.js v6 in Elementary OS using Terminal
Step 1: Open Terminal from applications.
Step 2: Enter following code.
1 2 |
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - sudo apt-get install -y nodejs |
If you are looking for to install nove v7, use following code instead of previous one
1 2 |
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash - sudo apt-get install -y nodejs |
In case if you receive any error, use sudo before curl. Like
1 2 |
sudo curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash - sudo apt-get install -y nodejs |
You can try the same for node v6
Step 3:(Optional)
You may also need to install build tools to compile and install native addons from npm.
1 |
sudo apt-get install -y build-essential |
Step 4: To test the Node is installed, enter node -v in terminal, it returns version number of node js. Something like this. v6.9.2
To test npm installed, enter npm -v in terminal, it returns version number of npm. Something like this. 3.10.9
Good Luck!
Leave a Reply
Want to join the discussion?Feel free to contribute!