Open johhnry opened 1 year ago
You can enable it using:
sudo corepack enable
Why does it need root privileges when it should be only installed as a user?
It tries to add the symlinks next to the corepack
binary, which is installed somewhere the current doesn't have permissions in your case. If you know a way to make it transparent for the user, feel free to share / send a PR.
It seems --install-directory
fixes it.
you should make symlinks to ~/.local/bin
folder
If someone finds this issue, just do the following:
sudo npm uninstall -g yarn pnpm corepack
sudo pacman -R npm
sudo pacman -S pnpm
pnpm install -g corepack
corepack enable
/home/${user}/.local/share/pnpm/
directory from the error messages until it workssudo pacman -R pnpm
pnpm install -g corepack
corepack enable
The last 2 steps are just to make sure.
How are you running step 7 if you've uninstalled pnpm in step 6?
Step 5 enabled the local version of it which was introduced by the global install of corepack via the system package version of pnpm.
While pnpm 8.x was still installed as a system package the terminal used the local pnpm 9.x.
It's sad that this is needed because npm install -g bla
wants root while pnpm
just installs it in the user directory....
So, fact is that corepack
does not work with system-managed versions of package managers like pnpm or yarn when there is a project-specific version that does not match the one installed in the system.
As this is a very common case when dealing with projects that are being worked on by multiple people as well as CI systems, it's highly recommended to use NVM (or something similar) for each project, which then makes any changes that corepack
does specific to this project only, not breaking or affecting other projects.
As a result, we add a .nvmrc
to all our projects, specifying the version, e.g. (for LTS 20.x):
lts/iron
...and then you can do this to initialize everything for local development:
nvm use
corepack enable
So no dealing with directories yourself and a stable developer experience across systems.
Hi,
I am running
corepack
on Nodev19.9.0
and Arch Linux6.3.1
and I can't enable it:Should this be reported on some Arch Linux channel or it's a corepack issue?
Thanks