I had a problem installing nodejs and npm on my Linux server (which is the raspbian pi server). I had everything configured and working with
sudo apt-get install nodejs npm
Everything was perfect and dandy, until I found out that, apparently, these versions have become old. So I deleted them
sudo apt-get purge nodejs npm
Then I found the following answer ( here ) on SO and ran
curl -sL https://deb.nodesource.com/setup | sudo bash - sudo apt-get install -y nodejs
Running node -v has version 0.6.19 ... which I suppose translates to version 6.19 as opposed to version 0. However, running npm -v told me that it was not installed. So I cleaned up nodejs again and was looking for another solution. At this point, I decided to follow the material on the nodejs website ( here ). And I executed the following commands.
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash - sudo apt-get install -y nodejs
and
sudo apt-get install -y build-essential
2 questions:
1) The installed version is still 0.6.19. I would prefer to have version 4.x, as this is what I am running on my dev machine (macOS Sierra).
2) I still do not have npm. What makes nodejs unnecessary
Any help on any (but preferably 2) would be great. Thanks in advance.
source share