[Solved] /usr/bin/env: node: Permission denied
Table of Contents
Step 1: Unlink the existing /usr/bin/node
sudo unlink /usr/bin/node
Step 2: Find the node path
whereis node
your result will be something like this,
/home/ec2-user/.nvm/versions/node/v14.7.0/bin/node
Step 3: Now link this path,
sudo ln -s /home/ec2-user/.nvm/versions/node/v14.7.0/bin/node /usr/bin/node
Step 4: Now try running sudo npm install
it should work without any issues.
If still doenst work. do the same for npm
ln -s /root/.nvm/versions/node/v10.13.0/bin/npm /usr/bin/npm