Reputation: 16234
The shebang line in my bin/www
file is:
pi:~/ferc$ head -n 1 bin/www
#!/usr/bin/env node
However, executing it:
pi:~/ferc$ bin/www
bin/www: line 1: #!/usr/bin/env: No such file or directory
The env
file does exist:
pi:~/ferc$ ls -lL /usr/bin/env
-rwxr-xr-x 1 root root 31408 Feb 18 2016 /usr/bin/env
The node
file also exists:
pi:~/ferc$ ls -al /usr/bin/node
lrwxrwxrwx 1 root root 15 Jul 7 18:29 /usr/bin/node -> /usr/bin/nodejs
And node
runs fine:
pi:~/ferc$ node -v
v4.2.6
What does the error message really mean? Which file is it complaining about?
Upvotes: 2
Views: 3872
Reputation: 16234
The cause was a corrupted file, probably due to a mixture of LF and CF/LF line endings in the file.
What happened were:
node
executable did not exist. I hadn't created the symbolic link yet.dos2unix
the www file, and the error went away.Upvotes: 1
Reputation: 37048
You can use node directly like:
#!/usr/bin/node
See pros and cons: https://unix.stackexchange.com/questions/29608/why-is-it-better-to-use-usr-bin-env-name-instead-of-path-to-name-as-my
Upvotes: 0