I'm installing Node.js on Ubuntu machine. I followed official instructions:
./configure && make && sudo make install
So, I got node binary in /usr/local/bin/node
and all dependencies. But when I run it from command line I get permission error:
> node
bash: /usr/local/bin/node: Permission denied
How can I fix it? How can I run it under my account? sudo node
doesn't work too.
This means you do not have permission to write to the directories npm uses to store global packages and commands. Try running commands: sudo chmod u+x -R 775 ~/. npm and sudo chown $USER -R ~/. npm or you can just run any npm command with sudo , that should get resolve your issue.
You need read- and executable permissions for others
. Issue:
sudo chmod +rx $(which node)
or
sudo chmod 755 $(which node)
However, normally make install
should set that permissions. Looks like something in the Makefile
is wrong.
For people with no knowledge of osx terminal, open it and use these commands:
su yourusername
su chmod 755 /usr/local/bin/node
sudo node install...
This will make the folder readable/writeable and the sudo before the node command will make it run under admin rights.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With