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!
@LespiletteMaxime
Copy link

Line 10: you forgot the "sudo" after &&

@danielvalentin
Copy link

This is awesome. Thanks alot.

Copy link

ghost commented Apr 17, 2014

Works fine! Tested on Debian 7.0 x64 in Digital Ocean

@dannykansas
Copy link

You were not lying about that make process. Did this on a raspberry pi and it took about three hours! Hope that info helps someone.

EDIT: It wasn't done. We're at 5 hours now. Holy smokes!

Copy link

ghost commented May 14, 2014

{ 'target_defaults': { 'cflags': [],
'default_configuration': 'Release',
'defines': [],
'include_dirs': [],
'libraries': []},
'variables': { 'host_arch': 'arm',
'node_install_npm': 'true',
'node_install_waf': 'true',
'node_prefix': '',
'node_shared_v8': 'false',
'node_shared_zlib': 'false',
'node_use_dtrace': 'false',
'node_use_openssl': 'true',
'node_use_system_openssl': 'false',
'strict_aliasing': 'true',
'target_arch': 'arm',
'v8_use_snapshot': 'true'}}
creating ./config.gypi
creating ./config.mk
Traceback (most recent call last):
File "tools/gyp_node", line 58, in
run_gyp(gyp_args)
File "tools/gyp_node", line 18, in run_gyp
rc = gyp.main(args)
File "./tools/gyp/pylib/gyp/init.py", line 471, in main
options.circular_check)
File "./tools/gyp/pylib/gyp/init.py", line 111, in Load
depth, generator_input_info, check, circular_check)
File "./tools/gyp/pylib/gyp/input.py", line 2289, in Load
depth, check)
File "./tools/gyp/pylib/gyp/input.py", line 433, in LoadTargetBuildFile
includes, depth, check)
File "./tools/gyp/pylib/gyp/input.py", line 387, in LoadTargetBuildFile
build_file_path)
File "./tools/gyp/pylib/gyp/input.py", line 984, in ProcessVariablesAndConditionsInDict
ProcessConditionsInDict(the_dict, is_late, variables, build_file)
File "./tools/gyp/pylib/gyp/input.py", line 861, in ProcessConditionsInDict
variables, build_file)
File "./tools/gyp/pylib/gyp/input.py", line 1010, in ProcessVariablesAndConditionsInDict
build_file)
File "./tools/gyp/pylib/gyp/input.py", line 1025, in ProcessVariablesAndConditionsInList
ProcessVariablesAndConditionsInDict(item, is_late, variables, build_file)
File "./tools/gyp/pylib/gyp/input.py", line 1010, in ProcessVariablesAndConditionsInDict
build_file)
File "./tools/gyp/pylib/gyp/input.py", line 1025, in ProcessVariablesAndConditionsInList
ProcessVariablesAndConditionsInDict(item, is_late, variables, build_file)
File "./tools/gyp/pylib/gyp/input.py", line 984, in ProcessVariablesAndConditionsInDict
ProcessConditionsInDict(the_dict, is_late, variables, build_file)
File "./tools/gyp/pylib/gyp/input.py", line 861, in ProcessConditionsInDict
variables, build_file)
File "./tools/gyp/pylib/gyp/input.py", line 984, in ProcessVariablesAndConditionsInDict
ProcessConditionsInDict(the_dict, is_late, variables, build_file)
File "./tools/gyp/pylib/gyp/input.py", line 842, in ProcessConditionsInDict
if eval(ast_code, {'builtins': None}, variables):
File "", line 1, in
NameError: name 'armv7' is not defined while evaluating condition 'armv7==1' in /tmp/node/deps/v8/tools/gyp/v8.gyp while loading dependencies of /tmp/node/node.gyp
while trying to load /tmp/node/node.gyp

@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