I'm getting command not found...
on a bin module I defined in my package.json. Why? I thought it was supposed to automatically map a local command into path.
In my module's package.json:
"bin": {
"testme": "./misc/testme"
},
./misc/testme script:
#!/usr/bin/env node
console.log("this is a test");
It appears in the node_modules/.bin directory
$ ls node_modules/.bin
acorn escodegen gulp kue-dashboard ncp semver stylus
cake esgenerate gzip-size lessc nopt shjs testme
cleancss esparse handlebars make-plural pretty-bytes sshpk-conv uglifyjs
coffee esvalidate image-size messageformat rc sshpk-sign user-home
dateformat express jade mime retrieve-arguments sshpk-verify uuid
dot-object geojsonhint jsonlint mkdirp rimraf strip-indent watchr
errno grunt js-yaml mustache sails strip-json-comments which
But, after npm install
when I run it, I get:
$ testme
bash: testme: command not found...
I believe that running testme
would only be possible if you'd install the package globally. In order to run this command (without the global installation) you'd have to npm run testme
and add this to your package.json file:
"scripts": {
"testme": "./bin/testme"
more info here: http://2ality.com/2016/01/locally-installed-npm-executables.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With