Thursday, September 5, 2019

software installation - How can I install a tar.xz file from nodejs.org?


I'm a novice with Ubuntu.


I downloaded nodejs from the nodejs.org website.


The file I downloaded is node-v7.1.0-linux-x64.tar.xz


I know how to extract it, but that's it.


Please explain how I can install it, and where I should put it in the filesystem.



If you want to install and switch between multiple versions of node then nvm (Node.js version manager) is better option.



  1. Check whether you have nvm or not.
    If not then 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.31.0/install.sh -o 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





  1. If you have multiple Node.js versions, you can see what is installed by typing:


    nvm ls

  2. You can install your specific node version by typing:


    nvm install 6.7.0

  3. If you wish to default one of the versions, you can type:


    nvm alias default 6.7.0

  4. Now you can also reference it by the alias like this:


    nvm use default

  5. Check now node version to verify whether changes are made or not by typing:


    node -v


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...