npx icon indicating copy to clipboard operation
npx copied to clipboard

--ignore-existing didn't work as expected

Open helenmasters opened this issue 7 years ago • 5 comments

I have a global install of the generator-swiftserver package at version 4.0.0, which is therefore on my PATH on macOS, this means that npx when it runs doesn't get the latest version of the generator-swiftserver package (which is currently at 4.5.0).

From reading the npx documentation I expected that using the --ignore-existing flag would allow me to get the latest version of a package, even when I have an earlier version of said package installed globally.

The code I ran was: npx -p yo@1 -p generator-swiftserver --ignore-existing -- yo swiftserver --init This did not install the 4.5.0 version of the package.

I am using npx version 9.7.1 on macOS High Sierra

helenmasters avatar Feb 07 '18 14:02 helenmasters

Huh, weird. I'll have to confirm this -- it might be out of npx's hands, though.

zkat avatar May 03 '18 22:05 zkat

i have the same problem trying to run a newer version of webpack regardless of what old version is installed.

something like this seems to me like the main usecase of --ignore-existing.. do you know any workaround?

sijakret avatar May 09 '18 13:05 sijakret

@sijakret I think this issue might have more to do with yeoman being weird about its generators, because pathing.

If you just wanna use a different webpack, use the @ syntax: npx webpack@1 ..., npx webpack@2 ..., etc.

zkat avatar May 10 '18 08:05 zkat

when i execute this: npx -p [email protected] webpack-dev-server --version in an npm project that has webpack-dev-server 2.11.2 installed it yields this output

webpack-dev-server 2.11.2
webpack 3.11.0

that's why i tried adding the --ignore-installed flag but it does not seem to change anything npx --ignore-existing -p [email protected] webpack-dev-server --version gives the exact same result

is this the expected behavior?

i am runnng npx v9.7.1 - maybe this is a problem, unfortunately i am somehow too stupid to upgrade npx - can you give me a hint? npm update -g npx does not work

sijakret avatar May 11 '18 10:05 sijakret

upgraded to npx10.2.0, but the initial problem remains

sijakret avatar May 11 '18 11:05 sijakret