Thursday, January 29, 2015

Quick how-to for installing nodejs and npm on Debian GNU/Linux 8.0 (jessie)

Here is quick how-to for installing nodejs and npm on Debian GNU/Linux 8.0 (jessie)

* # -> means that you should run command as root (use sudo command)
* $ -> means that you should run command as usual user (not root)

  1. Add source to apt (as root user) (nodejs.org)
        # apt-get install curl
        # curl -sL https://deb.nodesource.com/setup | bash -
        
  2. Then install nodejs package(as root use sudo command):
        # apt-get install -y nodejs
        
  3. In order to be able to compile and install native addons from npm you may also need to install build tools:
        # apt-get install -y build-essential
        
  4. Install npm (node package manager)
        # curl https://www.npmjs.com/install.sh | sudo sh
        
  5. To test your installation run the following commands as usual user (not root):
        $ node -v
        $ npm -v
        
  6. Done, enjoy .