Closed coderbyheart closed 7 years ago
@coderbyheart this is intentional: npx is meant to execute binaries, not execute arbitrary packages' main
.
Just add "bin": "./index.js"
and I think that'll work just fine 👍
Duh, my bad! Works now as expected. Thanks!
@coderbyheart Could you, please, go into detail of how this now works as expected? I ran into the very same problem just now and adding bin
did not solve my problem. Then I tried running npx @coderbyheart/xkcd-password
and got the same error (command not found
).
Hm. Is your setup up to date? It works for me:
m@nanshe ~ % npx @coderbyheart/xkcd-password
npx: installed 19 in 1.686s
cheaply lucency kinsman stagey
@coderbyheart Thanks for the info, must be my npm
version then.
Actually this could fix it for you: https://github.com/coderbyheart/xkcd-password/commit/f68e88123e5168e3b59e4d6ba34157399d89ad93
@coderbyheart Or I might not have flagged my executable properly at all, we'll never know :) Thanks for the tip!
The sourcecode for the package is here: https://github.com/coderbyheart/xkcd-password
The package is published as a scoped package at https://www.npmjs.com/package/@coderbyheart/xkcd-password
It seems npx ignores the scope when executing it.
Running npx from within the package source folder works: