-
Notifications
You must be signed in to change notification settings - Fork 52
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
Can't install module with Yarn 3.x (berry) #139
Comments
Yeah, this sounds like a bug in yarn. They've changed the order of scripts to not be compatible with existing packages. I urge you to open a bug report there. |
I think they are pushing toward more deterministic packages that don't rely on so many scripts during installation. Do you think the node npm package could come with everything pre-built to simplify the process? |
Not likely. Not unless all architectures (and OSes supported) of node packages were known at the build time of that node release and were included. that'd be > 1GB installed for a node version. If someone thinks of a clever way to do it I'm all ears. |
Could the package depend on an optionalDependency that would be compatible only for the specific architecture? So the |
That doesn't work very well with package-lock.json, because then you end up with the specific architecture locked. |
Would this recent addition help? https://dev.to/arcanis/yarn-31-corepack-esm-pnpm-optional-packages--3hak (conditional packages) Of course it would mean a Yarn-specific version would be needed. But TBH the Yarn approach seems more reliable |
@FezVrasta It might! How does one use such a thing? What file does that stuff that they're describing go into? |
Probably it would help to switch to the approach which esbuild uses and instead of using a post-install script, using the optionalDependencies: evanw/esbuild#1621 Maybe this could prevent a lot of edge cases? But then the different node packages (operating-systems, CPU combinations) must be available on npm as seperate packages... |
I also have this issue in the yarn repository I am working on. For my use case, I had to use https://dotslash-cli.com/ instead of this package. Considering yarn is the popular package manager, not a bad idea to support this to increase adoption. |
Yeah, the reason I haven't done what esbuild does is that adding more architectures or OSes later is impossible, since they have to be listed. |
Increasing adoption for increasing adoption's sake is a non-goal. |
We have #44 but it's about Yarn 1 I think.
yarn add node
results in an error with the following logs:I think the problem is that Yarn 3.x runs
preinstall
hooks as part of thepostinstall
cycle.https://yarnpkg.com/advanced/lifecycle-scripts#:~:text=For%20backwards%20compatibility%2C-,preinstall,-and%20install%20are
I'm on macOS 11.6 running Node.js 14.18.1
The text was updated successfully, but these errors were encountered: