0

Upon trying to install express via npm, bash was simply returning a command not found statement upon running any node module in the shell directly. I went through countless resources and forums to locate the issue and was not succesfull.

1 Answers1

-1

This seemed to be the solution for me. I ran the below statement and then proceeded to reinstall express as sudo:

chmod 777 /usr/local/lib

sudo install express -g

Run both commands respectively.

  • `chmod 777` -> nonononono! Never ever run `chmod 777`. It is practically never required! Not even for "testing purposes". If the file is readable, then it's readable. If it's writable by the `user` or `group` that need to write to it, then it's writable. There is absolutely zero need to give everyone write permissions, and forgetting to `chmod` it back to something sane is exactly how multinationals get hacked. Just don't do it. Ever. I wrote [an introduction of Unix permissions](http://stackoverflow.com/a/35895436/660921). Please read it! – Martin Tournoij Mar 13 '16 at 04:16