NodeJs permission denied error

Posted on 13-03-2017 by Nadir Latif


The error: sh: 1: node: Permission denied, usually occurs because the node binary does not allow execution with root privileges. To correct the error we need to run the commands:

npm config set user 0
npm config set unsafe-perm true
sudo npm install -g sm