I am trying to run basic CLI command, but after npm link
getting:
zsh: permission denied: testcom
File myfile contains:
#!/usr/local/bin/ node
console.log('Hello!')
Running ls -alh
:
-rwxr-xr-x 1 markhorton staff 46B 4 Dec 20:37 myfile
package.json:
{
"name": "katya",
"version": "1.0.0",
"description": "",
"main": "index.js",
"bin": {
"testcom": "myfile"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
However, running testcom
says permission is denied.
Would be vey grateful for any help or suggestions. Thank you very much, Katya
#!/usr/local/bin/node
. You're getting an error in trying to execute the directory/usr/local/bin
. – Prattmyfile
also has to have execute permission set. – Pratt