| ▲ | tuananh 5 days ago | |||||||||||||
native modules. nodejs can have native modules (written in C++, Rust, etc...). Projects usually ship prebuilt natives binaries (for each arch/OS/Nodejs ABI combination) hosted on GitHub Releases and download them automatically at installation time; fallback to build from source if not found. that's where scripts are used the reason for not bundling all native binaries is becasue the no. of combinations are huge and it can make module size hundreds of MBs | ||||||||||||||
| ▲ | sroussey 5 days ago | parent | next [-] | |||||||||||||
Having a non-script method of downloading the right native binary would be a good next step. | ||||||||||||||
| ||||||||||||||
| ▲ | bakkoting 5 days ago | parent | prev | next [-] | |||||||||||||
This used to be more common but the pattern these days is to have the binaries split into optionalDependencies which declare their supported CPU etc, one per supported platform. Then npm will install just the matching one (optionalDependencies that require a different platform aren't installed). The fact that most of the ecosystem has moved to this pattern is a big part of why this change is now feasible. | ||||||||||||||
| ||||||||||||||
| ▲ | rswail 5 days ago | parent | prev | next [-] | |||||||||||||
Not an NPM user, but you can't specify a set of arch combinations and NPM will get the appropriate prebuilts? That sounds like an NPM problem that would be relatively easy to fix. Can the builds be sandboxed with strictly limited capabilities? All of this sounds solvable, why hasn't it? | ||||||||||||||
| ▲ | vardump 5 days ago | parent | prev [-] | |||||||||||||
There should be a path for local building as well. Node.js is being used on a lot of embedded systems. I’d imagine there are also lots of other reasons for local builds. | ||||||||||||||
| ||||||||||||||