Fixing '/usr/bin/env: node: No such file or directory' Error on Ubuntu
Linux / Node.js
🐛 Fixing /usr/bin/env: node: No such file or directory
Error on Ubuntu
After installing Node.js and npm on Ubuntu, you might encounter the following error when running global npm packages (like stylus
):
/usr/bin/env: node: No such file or directory
This happens because, on some Ubuntu versions, the Node.js binary is installed as nodejs
instead of node
.
🔧 The Fix
Create a symbolic link named node
pointing to nodejs
:
sudo ln -s /usr/bin/nodejs /usr/bin/node
This command tells the system to use nodejs
whenever a program calls node
.
✅ After that
Try running your command again, and it should work without the error.
Happy coding! 👋