Fix for Bad interpreter: Operation not permitted

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

The simple fix:

xattr -d com.apple.quarantine /path/to/script

Reason:

Text editors like OSX’s TextEdit, Textastic and CodeRunner sometimes lock the file. This command fixed it.

Via: discussions.apple.com


Comments

One response to “Fix for Bad interpreter: Operation not permitted”

  1. After 2h of googling this is the solution for my problem! Thanks a lot.

Leave a Reply

Your email address will not be published. Required fields are marked *