So I have spend whole last weekend, the only two days I have to work on the project I spend by installing couple version of operating system and node.js. But I have end-up with many problems so let’s go through all of them one by one hopefully they will be also useful for you.
The first. I have installed raspbian version from early February. I don’t know why but it had some problems during node.js installation (unfortunately I don’t have logs to show as I have lost them) . Probably I was missing one or another library or simply I had stale libraries. So I have update whole apt tree apt-get update | apt-get upgrade but it didn’t help. I was unable to install any of node.js versions I’ve had. The hardest thing is the real problem could be somewhere else. The reason for that is not so mature node.js as a whole system (an idea). I have found X number of possible ‘best’ solution how to install node.js what version I should install also even on node.js website there are at list two or three ways to install node.js on linux. And which libraries we should have and how we should install it.
Solution: You can try use apt-get install node or apt-get install nodejs. I am not sure I have read it is exactly same things but apt-get install node didn’t work for me and apt-get install nodejs npm. Also as you can see I have added npm (node.js package manager) on the end of command line. Which I didn’t understand and I didn’t have time to try understand it but when I was install nodejs without npm it wasn’t working. Clear madness. Okay, so before install nodejs I have downloaded latest raspbian (which was released on the end of February). And it worked. Nodejs was installed.
Another problem was and will be with not again so mature libraries. E.g. I was trying to install ESP8266 library which need old serial port which of course I had latest one which didn’t worked. So I have old one but again now it was too old.
Later I have also tried ubuntu mate and Windows IoT. But raspbian seems to be the best choice.
Github repository: https://goo.gl/ii9xsz
Be positive and stay calm!