Note to self
Sometimes I get this error on the macOS Terminal or when running my script from the CodeRunner app:
bash: /path/to/script: /usr/local/bin/node: bad interpreter: Operation not permitted
Quick fix
xattr -d com.apple.quarantine /path/to/scriptReason
Text editors like OSX’s TextEdit, Textastic and CodeRunner sometimes lock the file. This command fixed it.
It also appears to happen when the editor (BBEdit) is changing the line-endings in the file to Windows CRLF format, instead of the *nix LF format. You can resolve this with the ‘dos2unix’ tool.
If you don’t have Homebrew installed, follow this guide.
Then in the Terminal run this command:
brew install dos2unixAnd to convert your file:
dos2unix /path/to/file
After 2h of googling this is the solution for my problem! Thanks a lot.