How to install Node.js and Ionic in Debian
apt only provides a really old ersion of node. Use nvm to install and manage different versions of node.js !
Reading
Install Node.js with nvm
- Install some necessary packages
apt-get install build-essential libssl-dev curl
- nvm global install
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.3/install.sh | 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.sh" ] && . "$NVM_DIR/nvm.sh" # 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