New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] regression - npm_config_prefix no longer works with global npx #5268
Comments
Relates microsoft/playwright#16281. It looks like this is not particular to |
The reason this is happening now is because I would recommend NOT using |
Thanks! For some additional context, Playwright discourage's using itself as a globally installed package. Instead, we ask users to explicitly depend on the package and invoke it via Playwright prints a warning if it thinks its being used in the global context. We have tests that check this message is present under some cases and absent in others. (i.e. In CI, we are testing the Playwright CLI itself.) The tests all set In this case, I don't think My alternative ideas are to:
Thanks for your time! |
You can make an |
@ljharb It looks like that gives the same error as it's equivalent to the env var:
Even doing:
produces the same error (with fresh install/config). Given the above, it looks like with 8.16.0 you can no longer use a non-default global install directory. |
There are two things happening here. First, the global prefix has a completely different layout than the local one, the second is that setting What this functionally means is that when you set #5291 fixes this specific case, leaving the |
Thanks so much @wraithgar! Appreciate the clarifications and the workaround/fix. |
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Using the
npm_config_prefix
results in ano such file or directory
error when attempting to run a command vianpx
globally onnpm@8.16.0
. The same command used to work onnpm@8.15.1
.Expected Behavior
Global npx command works in conjunction with
npm_config_prefix
outside of a project/workspace.Steps To Reproduce
Now, upgrade
npm
and repeat:💥 Observe
npx
errors and complainsThis is related to npm not being able to find a file.
.Environment
Additionally,
npm_config_prefix
is set when runningnpx
command.The text was updated successfully, but these errors were encountered: