node.js - npm bin property is not working as expected -
i wrote simple 'addheader' node module , published on npm. contains cli script registered in package.json config-file in bin property follows:
{ "name" : "addheader", "bin" : "./addheadercli.js" } installing module "npm install addheader" can see cli script in node_modules folder follows:
node_modules/.bin/addheader unfortunately can't use cli expected. when run this:
node addheader 'test.txt' 'a header' it fails following error:
error: cannot find module '/users/sepp/camp/npmbuild/addheader' @ function.module._resolvefilename (module.js:336:15) @ function.module._load (module.js:278:25) @ function.module.runmain (module.js:501:10) @ startup (node run providing path works fine:
./node_modules/.bin/addheader 'test.txt' 'a header' i've consulted npm documentation couldn't figure out i'm doing wrong.
by way i'm running node version 0.12.4 on mac.
you can find module on npmjs https://www.npmjs.com/package/addheader
if create bin should not invoking node it standalone binary.
karma
command not specified. karma - spectacular test runner javascript.
node karma
module.js:338 throw err; error: cannot find module
Comments
Post a Comment