Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save shizonic/fe7b24a33f16ee44aae810d0bc71631e to your computer and use it in GitHub Desktop.
Save shizonic/fe7b24a33f16ee44aae810d0bc71631e to your computer and use it in GitHub Desktop.
Install nodeJS on Kali Linux
#!/bin/bash
sudo apt-get install python g++ make checkinstall fakeroot
src=$(mktemp -d) && cd $src
wget -N http://nodejs.org/dist/node-latest.tar.gz
tar xzvf node-latest.tar.gz && cd node-v*
./configure
sudo fakeroot checkinstall -y --install=no --pkgversion $(echo $(pwd) | sed -n -re's/.+node-v(.+)$/\1/p') make -j$(($(nproc)+1)) install
sudo dpkg -i node_*
@shizonic
Copy link
Author

@cliffprogram
Copy link

mine has (npro) red label
i think that is my problem that causing installation failed

@wlad
Copy link

wlad commented Mar 15, 2021

UPDATE AS OF 2021

Check instructions here --> https://github.com/nodesource/distributions/blob/master/README.md#deb

Since Kali is Debian based what will apply is:

# Node.js LTS (v14.x):

# Using Debian, as root
curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -
apt-get install -y nodejs

# OR


curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo bash -
apt-get install -y nodejs

@wlad
Copy link

wlad commented Mar 15, 2021

if you get "the trying to overwrite error" i.e.

Preparing to unpack .../nodejs_14.16.0-deb-1nodesource1_amd64.deb ...
Unpacking nodejs (14.16.0-deb-1nodesource1) over (12.21.0~dfsg-1) ...
dpkg: error processing archive /var/cache/apt/archives/nodejs_14.16.0-deb-1nodesource1_amd64.deb (--unpack):
 trying to overwrite '/usr/share/doc/nodejs/api/packages.html', which is also in package nodejs-doc 12.21.0~dfsg-1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/nodejs_14.16.0-deb-1nodesource1_amd64.deb
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)

you can resolve it with

sudo dpkg -i --force-overwrite /var/cache/apt/archives/nodejs_14.16.0-deb-1nodesource1_amd64.deb
sudo apt --fix-broken install

check https://askubuntu.com/questions/1062171/dpkg-deb-error-paste-subprocess-was-killed-by-signal-broken-pipe for reference

@oakkaya
Copy link

oakkaya commented Jun 13, 2021

UPDATE AS OF 2021

Check instructions here --> https://github.com/nodesource/distributions/blob/master/README.md#deb

Since Kali is Debian based what will apply is:

# Node.js LTS (v14.x):

# Using Debian, as root
curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -
apt-get install -y nodejs

# OR


curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo bash -
apt-get install -y nodejs

Well done simple solving and node js setup method for debian derivative

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment