Npm link "The file is marked as executable, but cannot be launched by the operating system."

So, I created cli with package.json, which points to the bin file.

I npm link'd it. Then I created a new folder on my desktop and npm link fooclithat installed it in this folder node_modules.

Then I try to run cli from this directory, and it throws:

The file '/usr/local/bin/foocli' is marked as an executable but could not be run by the operating system.

Any idea what causes this and how can I fix it?

+4
source share
1 answer

#!/usr/bin/env node required at the top of the file that is executing, so the shell knows how to execute the file.

+7
source

Source: https://habr.com/ru/post/1627230/


All Articles