I was following along to this tutorial about setting up an express app. But when I ran node app.js
the server would not start. The previous command that I ran was
cd express_example && npm install
But I got this error
npm WARN engine express@4.9.8: wanted: {"node":">= 0.10.0"} (current: {"node":"0.8.4","npm":"2.1.4"})
npm WARN engine void-elements@1.0.0: wanted: {"node":">=0.10.0"} (current: {"node":"0.8.4","npm":"2.1.4"})
So i thought that it was because a newer version of node was necessary. So I looked at the version of node that I had, noticed it was older so I tried upgrading. But when I ran brew update node
i got this alert.
Error: node-0.10.32 already installed
I did some searching around and found this answer here on SO. Which suggested running these commands
sudo npm cache clean -f
then
sudo npm install -g n
then
sudo n stable
But the server still wont startup. But at least I am now at v0.10.33
I also found this similar question on SO whose accepted answer said to try sudo node app.js
but that just does not seem right, nor did it even work.