Example NodeJS installation for Linux

Blockchain Dealer
2 min readAug 5, 2018

--

Instructions can be followed and will yield similar results on most Linux distributions and processor architectures.

If you’re unsure what your architecture is, you can verify it in the Terminal by running uname -a OR dpkg --print-architecture

1. Download the current release of NodeJS

2. Extract the content of the .tar.xz archive to your Downloads

3. Open a Terminal window ( CTRL + ATL + T ) and copy the contents of the extracted folder to your /usr/ folder with sudo privileges

sudo cp -r ~/Downloads/node-v10*/* /usr/

If you’re interested in learning the above commands and more Linux usefulness, check out that resource.

If after executing the above command and running node -v you get an error, proceed to step 4, otherwise you’re good to go! back to How to Install Dat CLI

4. If you get any errors

  • open another Terminal window and try running node -v again
  • if it still doesn’t work, edit the hidden file ~/.profile with nano ~/.profile and add the following line at the end
export PATH=$PATH:/usr/bin/

… and run source ~/.profile to refresh your PATH variable

The PATH variable tells the system where to look for commands, if it isn’t configured to look at /usr/bin/ (where the node binaries were extracted), you will get issues because it won’t recognize any binary file named node — if you ran the command node -v.

Now you should have a properly installed NodeJS environment on your Linux Operating System.

You can try running node -v and npm -v if you’d like to confirm everything will run smoothly.

If you have any issues, please leave a comment and I will do my best to help you in a timely way and edit the instructions to better reflect possible scenarios.

back to How to Install Dat CLI

--

--