Open vjpr opened 7 years ago
This is related to https://github.com/zkat/npx/issues/113.
I'm open to a PR rewording some of these things, but be prepared for word-smithing.
As far as intentions go, the semantics of this feature are such that any time you do npx pkg@latest
, it should behave as if you've requested the actual latest version at that point in time. Having previously run npx pkg@latest
should not give you a stale installation, even if it was, say, yesterday. There are some optimizations to be done around this (which is what #113 is about), but those optimizations must not break the semantics. They should just be a bit smarter about caching.
The expected usage for npx is that if you have a command you run a lot, it should be actually installed. Preferably in your local project, but a global installation would work, too.
@zkat could you clarify how this relates to --no-install
? I'm happy to send a PR to clarify the behaviour, but I don't understand what the intended behaviour is here.
$ npx --no-install "commonmark@0.28.1" --version
npx: installed 5 in 1.49s
commonmark.js 0.28.1
$ npx --no-install "commonmark@0.28.1" --version
npx: installed 5 in 1.152s
commonmark.js 0.28.1
$ npx --version
9.7.1
I was surprised to see information about an install on the second npx
command.
@wilfred that looks like a bug, innit
Okey-doke, opened #156 :)
This seems like a good place to ask: where is the package installed if it isn't found? And is the package deleted afterwards?
@mattdiamond A tmp dir inside ~/.npm/_npx
which is removed after execution.
From readme:
I was initially confused by this as I thought the installation would be persisted. E.g When I run
npx cowsay@1 boo
twice, I did not expect it to install twice.We should make a note that
it will be installed prior to *each* execution in a temporary directory
.Also from readme:
The usage of
from a central cache
seems misleading, because I would expect it to re-use the cached module if I runnpx cowsay@1 boo
twice.