-
Notifications
You must be signed in to change notification settings - Fork 40
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 not available #26
Comments
OK, so this is probably going to be complicated.
I'm not sure the corepack model is going to be suitable for the Snap because of this need to install in a different path. It's just going to confuse users I suspect.
Unfortunately it's not a straightforward task. Have a look at https://github.com/nodejs/snap/blob/HEAD/snapcraft.yaml.sh, which generates https://github.com/nodejs/snap/blob/HEAD/snapcraft.yaml for each release line. If you get yourself setup to develop Snaps locally you can build them straight from these configs and try them out on your local machine. Have a look in the file for |
Unfortunately, corepack is not the same as a set of preinstalled package managers. It allows users to specify versions of package managers (via the "packageManager" field in package.json) for many projects. So, for example, I can specify [email protected] for package |
Yeah, sorry, I think https://github.com/nodesource/distributions is going to be a better option for this kind of customisability; attempting to make the Snap more flexible than it is and solve for more bespoke situations is an uphill battle that I don't think we can afford to fight at the moment; if it's even possible. Unless someone has a novel contribution to make here for packing, I think this one is off the table for the Snap. |
I have tried @rvagg proposed workaround, but it has its own issues. First: you need to run it as root to be able to write to
I do not see an easy way of getting this working permanently. |
I got around this by installing corepack via
after which
worked fine. The only caveat is that yarn is still installed via snap, so in order to use yarn via corepack, you must prefix yarn commands with
On Ubuntu 20.04, node version v18.15.0, npm version 9.5.0 |
Corepack is supposed to be included in Node > 16.10, but needs to be activated using
corepack enable
. When installing node with snap it seems like something is missing for this to work.Steps to reproduce:
I can still see the corepack binary is there under /snap/node/current/bin/corepack. But running it gives some other error:
The text was updated successfully, but these errors were encountered: