-
Notifications
You must be signed in to change notification settings - Fork 173
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
Corepack enable does not symlink to npm.js #138
Comments
Ah ok. Still, adding it by default ensures that the correct npm version is used? Is that not desirable? |
For the MVP we decided to leave it up to the npm project to decide whether they want Corepack to affect their binary by default or not. At the moment they didn't request it. If that's something you think would be a good idea, I think it'd be fair to raise the topic to them - I'm not aware of a public discussion yet 🤔 |
I'd even go so far as to expect that npm is actually calling corepack by default, since Node ships with both. I opened npm/cli#5109 |
If we allowing this, we can use it to use npm v6 for projects that don't want to upgrade lockfile to v2. e.g.:
This does not work. And NPM v7+ is annoying, it will upgrade and change the lockfile everytime but I cannot upgrade it. (See discussion in microsoft/TypeScript#49726 (comment)) |
@arcanis what would you consider as an official request from the npm team? And for nodejs to ship with npm wrapped by corepack by default, what would need to happen? |
@Jack-Works As the documentation mentions, you can explicitly enable it. corepack enable npm |
As long as Corepack has not reached version 1.0.0, such initiative is very unlikely to succeed. If the initiative is not supported by the npm team, it's also unlikely to succeed. |
I think because corepack is not symlinking to npm, when a project is configured to use another package manager, using npm does not throw error. That for me defeats the whole purpose of corepack... "packageManager": "yarn@3.2.1"
|
This works for me. > corepack prepare --all
Preparing npm@9.6.5...
Preparing pnpm@8.3.0...
Preparing yarn@1.22.19+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447...
> corepack enable
> npm -v
9.5.1
> corepack enable npm
> npm -v
9.6.5 |
Is this an oversight or on purpose?
The text was updated successfully, but these errors were encountered: