Computer Science Mojo

~ David's Notes on coding, software and computer science


How to install Node.js and Ionic in Debian

Category: Mobile     Tag: Ionic   Cordova   Linux  
By: David     On: Sun 24 July 2016     

apt only provides a really old ersion of node. Use nvm to install and manage different versions of node.js !


Install Node.js with nvm

  • Install some necessary packages
apt-get install build-essential libssl-dev curl
  • nvm global install
curl -o- | NVM_DIR=/usr/local/nvm bash
  • To enable it for all user: cut and paste the following from ~/.bashrc to /etc/bash.bashrc
export NVM_DIR="/usr/local/nvm"
[ -s "$NVM_DIR/" ] && . "$NVM_DIR/"  # This loads nvm
  • nvm install latest node.js
nvm install node
  • nvm install node.js 4.4.7
nvm install 4.4.7

Install cordova and ionic

npm install -g cordova ionic
  • Set default node.js version for terminal
nvm alias default 4.4.7