Closed doowb closed 6 years ago
Hi @doowb, I just happened to come across this. I've been able to execute local packages by passing the directory path directly to npx, like:
$ npx ../../some-package
The some-package
directory is the root of an npm package, in this case.
I think that's what's meant in the README when it says local directories
for All package specifiers understood by npm may be used with npx
.
Does that help you?
Thanks @DanArthurGallagher. I tried that and I get:
$ npx ../../../some-folder/some-package
command not found: ../../../some-folder/some-package
However, this did work for me:
$ npx ../../../some-folder/some-package/bin/cli.js
I had tried that before using the file:
specifier but it didn't work. Thanks for the suggestion to get me to the correct place.
The readme says that I can specify a local directory but doesn't give any examples on how to do it. I've tried using the same syntax that would be used in
package.json
for dependencies, but that's not working:I've looked at different places in the code to see if there was another way to specify it, but it looks like the raw spec is being passed as the command instead of a resolved spec. I've also tried passing in the specific file used in the
bin
folder, but that doesn't work either.I'm using
npm 6.1.0
on mac osx.