Usage Error: This project is configured to use <pkgmgr>

See original GitHub issue

One 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:closed
  • Created a year ago
  • Reactions:3
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mehulkarcommented, Aug 9, 2022

I would also like to be able to run things like yarn --version or npm --version in a situation where corepack is enabled. This early UsageError prevents me from doing that. While debugging @nathanhammond and I noticed that config.json contains an allowlist of commands that are passed through: https://github.com/nodejs/corepack/blob/312d9ea6f107ef05c7e8955538b9abd9f857f8a6/sources/main.ts#L46-L55

I’m not sure if my case is a good use case for this config, but may be a good place to start?

1reaction
aduh95commented, Aug 8, 2022

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?.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found