Usage Error: This project is configured to use <pkgmgr>
See original GitHub issueOne of the biggest problems I have today with Corepack is the Usage Error: This project is configured to use <pkgmgr>.
This happens when I run npm i -g vercel@latest in a project that is configured to use yarn or pnpm. This seems a little too strict because the global flag (-g) is not scoped to my current project.
Similarly, vercel dev will shell out to npm or npx and corepack being enabled could block it from working properly, even if the system has npm installed.
While I think the intention is good (catch accidental typos), I think this shouldn’t be the default behavior because it is too restrictive. Perhaps making this strict mode be opt-in would help Corepack go stable (see #104).
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:8 (5 by maintainers)
Top Results From Across the Web
`pnpm install` Usage Error: This project is configured to use yarn
I am trying to migrate from yarn to pnpm. I ran pnpm install . It instantly failed and printed to the console: Usage...
Read more >Windows Package Manager error on Windows 7 x64
Pkgmgr.exe is not an executable we launch from our IIS custom actions. It may be possible that using ASP.NET version (which launches ...
Read more >Note pkgmgr.exe has been deprecated please update your
error : Note pkgmgr.exe has been deprecated please update your scripts to use dism.exe when trying to install Sony movie studio 13. Hi...
Read more >Corepack - styfle
The biggest caveat I've found today is that Corepack can sometimes be too strict and cause Usage Error: This project is configured to...
Read more >Enabling Windows Roles and Features During a Suite ...
Edition:The Advanced UI project type is available in the InstallShield. ... Image Servicing and Management (DISM.exe) and Package Manager (Pkgmgr.exe) use ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I would also like to be able to run things like
yarn --versionornpm --versionin a situation where corepack is enabled. This earlyUsageErrorprevents me from doing that. While debugging @nathanhammond and I noticed thatconfig.jsoncontains an allowlist of commands that are passed through: https://github.com/nodejs/corepack/blob/312d9ea6f107ef05c7e8955538b9abd9f857f8a6/sources/main.ts#L46-L55I’m not sure if my case is a good use case for this config, but may be a good place to start?
Or it could spawn a prompt:
You are running a command the uses <pkgmng> in a directory configured to use <pkgmng>. Do you want to continue?.