package.json with "bin" typo causes cryptic chmod error messages #4668

Closed
nicks opened this Issue Feb 13, 2014 · 3 comments

Comments

Projects
None yet
3 participants

nicks commented Feb 13, 2014

Repro steps:

  1. Create a package.json with a "bin" like:
    "bin": {"my-script": "./bin/typo.js"}
  2. Publish the package
  3. Try to install the package anywhere.

Expected result:
I should get an error message about the script file being missing at step (2), or at worst at step (3)

Actual result:
I get an error message at step (3) that says chmod failed. Here is a sample log:

npm ERR! Error: ENOENT, chmod '/Users/nick/git/kew/node_modules/closure-npc/bin/typo'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/isaacs/npm/issues>

npm ERR! System Darwin 13.0.0
npm ERR! command "/usr/local/Cellar/node/0.10.25/bin/node" "/usr/local/lib/node_modules/npm/bin/npm-cli.js" "install" "."
npm ERR! cwd /Users/nick/git/kew
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.24
npm ERR! path /Users/nick/git/kew/node_modules/closure-npc/bin/typo
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/nick/git/kew/npm-debug.log
npm ERR! not ok code 0
Owner

isaacs commented Feb 16, 2014

Patch welcome to warn on missing bin files. Should be made to https://github.com/npm/read-package-json.

Patch welcome (to this repo) to provide a better error message in lib/build.js where it's doing that work.

nicks commented Feb 16, 2014

Thank you for the pointers. I'll give it a try.

@nicks nicks referenced this issue in npm/read-package-json Feb 16, 2014

Closed

Validate scripts in 'bin', warn if they don't exist. #35

Contributor

othiym23 commented Feb 13, 2015

This is landed as part of upgrading to read-package-json@1.3.1. Thanks again, @nicks!

@othiym23 othiym23 closed this Feb 13, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment