Skip to content
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

Drop the corepack package manager strict check when invoked by another process #209

Open
kenrick95 opened this issue Nov 8, 2022 · 4 comments

Comments

@kenrick95
Copy link
Contributor

Tracking Option 2 proposed by @nathanhammond from #195 (comment) as a separate issue since that issue has been closed

  1. Drop the corepack check when invoked by another process

As per 0.15.0, Option 3 has been implemented:

  1. Push the solution to consumers via COREPACK_ENABLE_STRICT=0 <whatever> install

but I guess we can still pursue Option 2 so that Corepack adoption and developer experience would be better

@arcanis
Copy link
Contributor

arcanis commented Nov 8, 2022

I'm still against dropping the check in any kind of "by default" behaviour. Using the wrong package manager for the currently installed project is broken and should be fixed upstream. Corepack is the wrong layer for that.

@nathanhammond
Copy link

I have no horse in this race. Out of context this proposal feels a lot stronger than I ever intended for it to be. It was originally presented as just one option along a spectrum of correctness versus pragmatism.

It may still be worth considering, but it's entirely reasonable to delay implementation.

@styfle
Copy link
Member

styfle commented Jan 8, 2024

Using the wrong package manager for the currently installed project is broken and should be fixed upstream

@arcanis I don't know how this can be fixed upstream.

For example, today I tried to install @replayio/playwright using pnpm.

pnpm install
Scope: all 25 workspace projects
Lockfile is up to date, resolution step is skipped
Packages: +108 -10
Progress: resolved 108, reused 108, downloaded 0, added 0, done
node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@replayio/playwright: Running install script, failed in 81ms
.../node_modules/@replayio/playwright install$ npm run if:dist -- node ./bin/replayio-playwright first-run
│ Usage Error: This project is configured to use pnpm
│ $ npm ...
└─ Failed in 81ms at /node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@replayio/playwright
 ELIFECYCLE  Command failed with exit code 1.

What should @replayio/playwright use instead here that would support every package manager?
https://github.com/replayio/replay-cli/blob/025420d7528f34fcb95562eda195076fa04fdda0/packages/cypress/package.json#L11C1-L11C1

I think #57 could solve this but it looks like it was rejected.

@arcanis
Copy link
Contributor

arcanis commented Jan 8, 2024

In theory, $npm_execpath run instead of npm run. Which gets tricky with Windows, so the easiest and most portable option is usually to make the install script a .js file ...

Yarn 2+ supports dropping the $npm_execpath and only use run, but no other package manager does. Would be nice if this could be standardized across the board.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants