sudo tar -C /usr/local --strip-components 1 -xzf node-v8.1.1-linux-x64.tar.gz
-x, --extract, --get
extract files from an archive
-f, --file ARCHIVE
use archive file or device ARCHIVE
-z, --gzip, --gunzip --ungzip
You may find a list of Node.js versions on http://nodejs.org/dist/
You should now have both Node.js and npm installed in “/usr/local/bin”. You can check this by typing:
ls -l /usr/local/bin/node ls -l /usr/local/bin/npm
*An alternative way to install Node.js via the package manager:
First, download the
.tar.xz file from https://nodejs.org/en/. After the download is complete, press Ctrl + Alt + T to open your terminal.
Next, navigate to the location where you saved the downloaded file. In my case, it is the Downloads folder. Execute the following command to install Node.js:
sudo tar -xf node-v16.0.0-linux-x64.tar.xz --directory=/usr/local --strip-components=1
In order to install from source code, you will need to download the source code from https://nodejs.org/dist/v4.1.2/node-v4.1.2.tar.gz.
The file with the extension .tar.gz is a compressed file similar to a zip file. Before you can proceed with any other operations, you must first extract this file.
You can extract the file to any location you desire. To do this, open your terminal and navigate to the directory where the .tar.gz file is located:
$ cd /path/to/tar.gz/file
Next, use the tar command to extract the contents of the file:
$ tar xvzf node-v4.1.2.tar.gz
Once the extraction is complete, change your current directory to the extracted directory:
$ cd node-v4.1.2
Afterwards, you can proceed with running the
.configure command and the ‘make’ command:
$ [sudo] make install
- How can I verify and update the Node.js version on Ubuntu?
- The login is invalid due to a mismatch in the username and password, as error 535-5.7.8 indicates that they are not accepted.
- Is it preferable to serve static files using Express or nginx in Node.js?
- The usage of ES2015 module syntax is favored over custom TypeScript modules and namespaces as per the rule @typescript-eslint/no-namespace. So, it is advised to rewrite the sentence accordingly in any context if necessary.
- The npm install command in Node.js encounters an error C2373 when used in conjunction with Visual Studio 2015 Update 3. Rewrite this sentence and simply return it rewritten without any additional text.