How to install npm on debian vagrant box?

How can I install npm inside the Debian firewall? I am trying to do this, but it is not wotking.

vagrant @ packer-debian-7: ~ $ sudo apt-get install nodejs
Reading package lists ... Done
Creating a dependency tree
Reading status information ... Done
nodejs is already the newest version.
0 updated, 0 newly installed, 0 removed and 82 not updated.
vagrant @ packer-debian-7: ~ $ nodejs -v
v0.10.29
vagrant @ packer-debian-7: ~ $ sudo apt-get install npm
Reading package lists ... Done
Creating a dependency tree
Reading status information ... Done
E: Could not find npm package
vagrant @ packer-debian-7: ~ $ npm -v
- bash: npm: command not found

My operating system is Ubuntu

+6
source share
2 answers

execute the command:

 wget https://npmjs.org/install.sh sudo chmod +x install.sh sudo ./install.sh 

he will install npm on your stray box.

+3
source

A debian way would be to add a repo and install using apt-get

 curl --silent --location https://deb.nodesource.com/setup_0.12 | sudo bash - sudo apt-get update sudo apt-get install --yes nodejs 

This will install the nodejs and npm debian method

Here you have a roaming position I build that comes with nodejs https://github.com/Sudakatux/vagrant-liferay-others

+8
source

All Articles