npm install not working via php system() (exec / shell_exec) npm install not working via php system() (exec / shell_exec) nginx nginx

npm install not working via php system() (exec / shell_exec)


It appears that $PATH doesn't include /bin when called as an npm script so it fails to find /bin/sh per error file sh.

The solution is to symlink /bin/sh to /usr/bin/sh:

ln -s /bin/sh /usr/bin/sh