-
Notifications
You must be signed in to change notification settings - Fork 192
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
How to corepack self update? #305
Comments
I think just running |
No, on Windows it is not working |
The first workaround offered by @rotu works well on windows if corepack is already installed through your nodejs install, though you may have to move the path of nodejs from system to user variables. |
The preferred option is to use the Corepack version that is distributed along with Node.js itself. So if you want to update Corepack, you can update your Node.js version. 😃 |
It does work on Windows 11. This is what I've used to workaround these issues:
node -v
# v22.13.1
corepack -v
# 0.30.0
npm install -g corepack@latest
# changed 1 package in 463ms
corepack -v
# 0.31.0 |
This did not work for me. I had to uninstall NodeJS and then reinstall it, making sure to disable the corepack integration in the installer. After it was reinstalled without corepack, I could manage corepack via npm. Hopefully this helps someone out. |
This comment has been minimized.
This comment has been minimized.
As @trevor-hackett described, you need to disable the "corepack manager" feature if you installed Node.js using a Windows msi package and you want to update the version of Corepack. You can access this through Windows Settings > Apps > Installed Apps Then if you execute npm install -g corepack@latest it will install Corepack globally and Windows will not have two different versions of Corepack installed - one from msi and another from npm. |
I would like to suggest adding an "Updating Corepack" section to the README to describe how to update Corepack after installing Node.js according to any of the methods described on the Download Node.js page. |
|
Please check the updated Corepack Manual Installs section which includes additional advice for dealing with Windows Installer .msi installations when manually updating with npm: |
@MikeMcC399 I don't get it. Please point me where I wrong. At this point I'm expecting that everything will work as previously with as Nodejs has installed within Corepack. But it doesn't. The path Am I reinstalled corepack wrong or something else? |
Could you please open a separate issue for this? You have discovered a different issue working with Node.js msi. This issue is closed, so it is not a good place to be looking at a new problem. If you open a new issue I can give you some tips about what you should do next. |
The short version of the advice to you is as follows, since Node.js
If you want more detail, then please open a new issue. |
How should I update the version of corepack?
Since corepack is installed system-wide with Node, it's likely that existing installations (like my Windows machine) will have outdated versions.
For example, the LTS Node installer installs
0.18.0
but the latest version is0.20.0
and has commands that don't exist in previous versions.A couple options:
$PATH
so theC:\Users\dan\AppData\Roaming\npm
comes beforeC:\Program Files\nodejs
andnpm install --global corepack
corepack='npx corepack@latest'
in my shell profile.cd 'C:\Program Files\nodejs'; npm install corepack@latest --prefix .
npm install --global corepack
The text was updated successfully, but these errors were encountered: