Feature request: provide pre-compiled binaries (official builds) in npm packages
See original GitHub issueCurrently npm install ffi
requires building node-ffi from the source with node-gyp (on Windows the prerequisites are Python and MSVC, the latter is huge).
To get rid of this requirement (and thus to attract more end users and less building-related issues reported), please accomplish the following:
- Require (and use) node-bindings.
- Compile binary part of node-ffi for the supported platforms (win32/ia32, darwin/x64, linux/ia32, linux/x64… sunos/ia32?), put the resulting binaries inside your npm package and let node-bindings pick one on user’s side.
- Put
binding.gyp
in.npmignore
, otherwise npm will still attempt to build from the source. (Do not forget to add some contents of.gitignore
to.npmignore
when you create the latter, but only some: npm should not ignore the binaries.) - (optional) Put binaries in
.gitignore
to prevent them from being hosted on GitHub. (This step is necessary only if you hate mixing sources with binaries. This step may also be completed already if you build inbuild/
, which is currently in.gitignore
.)
After that npm install ffi
would involve only downloading and unpacking, and thus would just work.
Issue Analytics
- State:
- Created 11 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
package.json
Description. This document is all you need to know about what's required in your package.json file. It must be actual JSON, not just...
Read more >3 Common Tasks
For example, use require recipes-core/ package / file .inc instead of require file .inc . ... Sometimes, you need to add pre-compiled binaries...
Read more >5 Ways to install Node.js
js and provided 4 options: Official Installer; Version manager ( nvm or n ); Package Manager ( apt , brew , etc.) ...
Read more >11 Features in Node.js 18 you need to try
Details of Node.js 18 new features, including fetch API and test ... Node.js always provides pre-built binaries for various platforms.
Read more >Nixpkgs 22.11 manual
With these expressions the Nix package manager can build binary packages. ... To temporarily allow all unfree packages, you can use an environment...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for the writeup, but I’m not going to do this. It’s just too much work on the maintainer to have to be constantly recompiling binaries for all platforms whenever the native source code changes. I tried it out for a little while but it’s just unmaintainable.
It’s a pain, but until node has some kind of build farm setup for native modules, then Windows users are just gonna have to install their build chain and compile manually like everyone else.
Don’t fret though, getting some sort of blessed native addon workflow is going to be one of my main goals for node v0.9.
There is already an appveyor.yml file in this repo. It is just not being used.
And there are recent binary files in this repo: https://github.com/Icenium/node-ffi
So it may not be that hard.