Installing Node.Js on Debian 6.0

Installing node.js on Debian 6.0

Although, as ArjunShankar says, you should normally use a pre-built package. Node.js is rather too fast moving for Debian packages to keep up. I would strongly recommend that you do your own installs until such a time as Node settles down. For example, there was an unexpected update recently that fixes an important security loophole - you do not want to be dependent on a package that is for an out-of-date version of Debian when things need to move fast.

Instead, you should install from source.

You can download the source archive direct unpack it into a temporary folder and follow the instructions on the Node Github page. Alternatively, if you are confident with GIT, you can use that to grab the source - again to a temporary folder & follow the installation instructions.

There are a number of software dependencies for compiling so you need to make sure that you have them first - they should all be in the Debian apt packages. See http://blog.timmattison.com/archives/2011/04/26/installing-nodejs-couchdb-and-npm-on-debian-the-easy-way/ or http://sekati.com/etc/install-nodejs-on-debian-squeeze for further information.

It will take a few minutes to do the compile so be patient.

Once you've done it once, upgrades are also easy - just repeat the download/compile process.

Node.js installations now include the npm tool so installing libraries and other code is extremely simple.

Installing node.js on Debian 6.0

Although, as ArjunShankar says, you should normally use a pre-built package. Node.js is rather too fast moving for Debian packages to keep up. I would strongly recommend that you do your own installs until such a time as Node settles down. For example, there was an unexpected update recently that fixes an important security loophole - you do not want to be dependent on a package that is for an out-of-date version of Debian when things need to move fast.

Instead, you should install from source.

You can download the source archive direct unpack it into a temporary folder and follow the instructions on the Node Github page. Alternatively, if you are confident with GIT, you can use that to grab the source - again to a temporary folder & follow the installation instructions.

There are a number of software dependencies for compiling so you need to make sure that you have them first - they should all be in the Debian apt packages. See http://blog.timmattison.com/archives/2011/04/26/installing-nodejs-couchdb-and-npm-on-debian-the-easy-way/ or http://sekati.com/etc/install-nodejs-on-debian-squeeze for further information.

It will take a few minutes to do the compile so be patient.

Once you've done it once, upgrades are also easy - just repeat the download/compile process.

Node.js installations now include the npm tool so installing libraries and other code is extremely simple.

Installing nodejs on Debian 6

I don't know the steps you took to compile from source. This is what I used and It worked well on multiple servers:

sudo apt-get install git build-essential

sudo apt-get install wget

wget (link to node.js source -> found on nodejs.org/download/)

tar xvf node(press tab to auto load the version you're on)

pushd node(again, use tab)

./configure

make

sudo make install

TO TEST:

node

0.1 + 0.2

You should receive a response. All set.

How can I install nodejs manually in Linux from terminal

You can't install the file using npm install, but since you already have the compressed file for node, my answer will hopefully help you achieve your goal.

First of all you will have to extract the tar.gz file you have node-v15.6.0-linux-x64.tar.gz, to do so just navigate to the folder where the file placed in then do the below command.

tar xf node-v15.6.0-linux-x64.tar.gz

Since you're using Linux the below command will add the new extracted node to your path.

nano ~/.profile

Add the following lines to the end:

# NodeJS
export NODEJS_HOME=/{path_to_the_extracted_folder}/node-v15.6.0-linux-x64/bin
export PATH=$NODEJS_HOME:$PATH

Please make sure you change {path_to_the_extracted_folder} to the path where you extracted the compressed file in the previous step.

Finally you can click CTRL+C to exit nano, type y then click enter.
To refresh the profile file enter the below code

. ~/.profile

Finally

To make sure everything is working fine check the nodeJs version by entering this command node -v it has to print v15.6.0.

You will not have to worry about the previously installed node version since above steps will change the nodeJs path.

Installing nodejs and npm on linux

I really recommend you install node and npm using nvm. This is the fastest, cleanest and easiest way to do it.

That way, you install NVM simply doing:

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.3/install.sh | bash

To test that nvm was properly installed, close and re-open Terminal and enter nvm. If you get a nvm: command not found message, your OS may not have the necessary .bash_profile file. In Terminal, enter touch ~/.bash_profile and run the above install script again.

And you are now able to install node typing:

nvm install <version>

For example

nvm install 4.2.1

if you just want to install the latest node version, you can just type

nvm install node

In order to access node and npm as sudo (in order to have <1024 ports) you should run

n=$(which node)
n=${n%/bin/node}
chmod -R 755 $n/bin/*
sudo cp -r $n/{bin,lib,share} /usr/local

How to install node.tar.xz file in linux

Steps to download and install node in ubuntu

Step 1: Download latest or recommended node .tar.xz file from https://nodejs.org/en/

or you can download node version 14.15.5 (.tar.xz file) directly from here ->

https://nodejs.org/dist/v14.15.5/node-v14.15.5-linux-x64.tar.xz

Step 2: Go to the directory in which (.tar.xz file) is downloaded.

In my case --> /Download directory

Step 3: Update System Repositories

sudo apt update

Step 4: Install the package xz-utils

sudo apt install xz-utils

Step 5: To Extract the .tar.xz file

sudo tar -xvf name_of_file

In my case --> sudo tar -xvf node-v14.15.5-linux-x64.tar.xz

Step 6: sudo cp -r directory_name/{bin,include,lib,share} /usr/

In my case --> sudo cp -r node-v14.15.5-linux-x64/{bin,include,lib,share} /usr/

Step 7: Update the Path export PATH=/usr/node_directory_name/bin:$PATH

In my case --> export PATH=/usr/node-v14.15.5-linux-x64/bin:$PATH

Step 8: Check the node version

node --version

Result In my case -> v14.15.5

Nodejs always installing 4.2.6

In Linux/Mac systems, there is no better way than nvm - Node Version Manager.

Install:

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"

Then, usage is as simple as:

nvm install 8.0
nvm use 8.0

If after reboot you will see old version, use nvm alias to set your version as default one.

Note: If you're a happy user of new M1 Apple chip, install version 15 of Node.js with nvm, it supports it out of the box.



Related Topics



Leave a reply



Submit