The following article worked:
use nvm
https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-16-04
- sudo apt-get update
- sudo apt-get install build-essential libssl-dev
Once the prerequisite packages are installed, you can pull down the nvm installation script from the project’s GitHub page. The version number may be different, but in general, you can download it with
curl
:
- curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh -o install_nvm.sh
And inspect the installation script with
nano
:
- nano install_nvm.sh
Run the script with
bash
:
- bash install_nvm.sh
It will install the software into a subdirectory of your home directory at
~/.nvm
. It will also add the necessary lines to your ~/.profile
file to use the file.
To gain access to the nvm functionality, you’ll need to log out and log back in again, or you can source the
~/.profile
file so that your current session knows about the changes:
- source ~/.profile
Now that you have nvm installed, you can install isolated Node.js versions.
To find out the versions of Node.js that are available for installation, you can type:
- nvm ls-remote
No comments:
Post a Comment