nginx reload breaks node install
I followed the linode documentation on NGINX + NODE (such an easy walkthrough, by the way!) and successfully set everything up.
However one thing I noticed is that whenever I change my sites-available file and reload the server (sudo service nginx reload) the bash can't find 'node' anymore. Re-running (nvm install 0.10) fixes this, but that's going to get annoying really quickly.
Any suggestions?
1 Reply
It could be related to missing environment PATH locations.
I think that NPM was not installed in the root, so I can't run the command without sudo, but sudo won't find the correct path because it's looking in the root.
The workaround was to use:
sudo env "PATH=$PATH" npm install
But this is still just a hack.
This same issue resurfaced elsewhere.. when I was trying to install a node-gyp module, the npm install failed because I was using sudo. I read that I had to add the extra flag:
sudo env "PATH=$PATH" npm install –unsafe-perm
But it's still not working for me, and I'm dead in the water without being able to run my app.
Any thoughts?