Git Product home page Git Product logo

Comments (8)

zauni avatar zauni commented on July 19, 2024 1

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...

from node-bin-gen.

aredridel avatar aredridel commented on July 19, 2024

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.

from node-bin-gen.

FezVrasta avatar FezVrasta commented on July 19, 2024

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?

from node-bin-gen.

aredridel avatar aredridel commented on July 19, 2024

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.

from node-bin-gen.

FezVrasta avatar FezVrasta commented on July 19, 2024

Could the package depend on an optionalDependency that would be compatible only for the specific architecture? So the node package would list several optional deps, one for each architecture, and npm/yarn would only download the compatible one.

from node-bin-gen.

aredridel avatar aredridel commented on July 19, 2024

That doesn't work very well with package-lock.json, because then you end up with the specific architecture locked.

from node-bin-gen.

FezVrasta avatar FezVrasta commented on July 19, 2024

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

from node-bin-gen.

aredridel avatar aredridel commented on July 19, 2024

@FezVrasta It might! How does one use such a thing? What file does that stuff that they're describing go into?

from node-bin-gen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.