Skip to content

Instantly share code, notes, and snippets.

@x-Code-x
Created April 30, 2012 20:52
Show Gist options
  • Star 46 You must be signed in to star a gist
  • Fork 14 You must be signed in to fork a gist
  • Save x-Code-x/2562576 to your computer and use it in GitHub Desktop.
Save x-Code-x/2562576 to your computer and use it in GitHub Desktop.
Install npm node.js on Debian Squeeze / Wheezy / Linux Mint Debian Edition
#Quick cp from http://sekati.com/etc/install-nodejs-on-debian-squeeze
#
#Needed to install TileMill from MapBox
#
#Installs node.js which has npm bundled
#
#Build Dependencies
sudo apt-get update && apt-get install git-core curl build-essential openssl libssl-dev
#Install Node.js & NPM
git clone https://github.com/joyent/node.git
cd node
# 'git tag' shows all available versions: select the latest stable.
git checkout v0.7.8
# Configure seems not to find libssl by default so we give it an explicit pointer.
# Optionally: you can isolate node by adding --prefix=/opt/node
./configure --openssl-libpath=/usr/lib/ssl
make
make test
sudo make install
node -v # it's alive!
# Luck us: NPM is packaged with Node.js source so this is now installed too
# curl http://npmjs.org/install.sh | sudo sh
npm -v # it's alive!
@DenisCarriere
Copy link

Works great, it didn't take so long for me, about 20 minutes or so to do the "make"

@purplejacket
Copy link

On a Google Compute Engine n1-standard-1 (1 vCPU, 3.8 GB memory) make took:
real 6m46.780s
user 6m9.980s
sys 0m21.200s

@danivegamx
Copy link

How can I upgrade node and npm if I installed from here? It installed me old versions.

@LutzL
Copy link

LutzL commented Oct 8, 2014

Thanks for the doc! I used checkinstall, that way i could remove installed stuff quickly:
(i did not have tested the remove-procedure)

cd node/
#[checkout stable...]
# checkinstall creates a .deb-pkg and you can remove the installation with dpkg -r 
#1. create doc-pak dir.  checkinstall will use this to produce the /usr/share/doc/[pkg-name]/ dir...
    mkdir doc-pak
   cp README INSTALL COPYING Changelog TODO CREDITS doc-pak
   cp ChangeLog LICENSE CONTRIBUTING.md README.md AUTHORS doc-pak/
#2. create the package description for the package-management:
   cat > description-pak <<EOF
   * nodejs 2014.09.16, Version 0.10.32 (Stable)
   * npm: Update to 1.4.28
EOF
#3.  let checkinstall run the make-install-process 
#    --pkgname nodejs   the name of the pkg in the package-management 
#    -D   create also a .deb-file in the local-dir
#    --gzman  compress manpages
# must be run as root-user:
checkinstall -D  --pkgname nodejs --gzman  make install
# every installed file is now known by the package-management
# the package can be removed with:
#    dpkg -r nodejs 
# list of installed files:
less /var/lib/dpkg/info/nodejs.list 

@LutzL
Copy link

LutzL commented Oct 8, 2014

how can i find out the stable-version nb. ? i visited the the project-webpage and viewed the changed-log with 'git show'. i'm not sure if this is a recommended way.

@meshelluh
Copy link

Worked well for me, didn't take to long. Thank you!

@fadlikadn
Copy link

It works great. Thank you!

@tantaroth
Copy link

Muy buen aporte, gracias!

@webhat
Copy link

webhat commented Jul 14, 2017

I'd add --depth 1 to git clone https://github.com/nodejs/node.git so you don't download the whole repo:

git clone --depth 1 https://github.com/nodejs/node.git

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