question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: provide pre-compiled binaries (official builds) in npm packages

See original GitHub issue

Currently 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:

  1. Require (and use) node-bindings.
  2. 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.
  3. 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.)
  4. (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 in build/, which is currently in .gitignore.)

After that npm install ffi would involve only downloading and unpacking, and thus would just work.

Issue Analytics

  • State:closed
  • Created 11 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
TooTallNatecommented, Jun 21, 2012

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.

0reactions
kroggencommented, Aug 26, 2016

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.

Read more comments on GitHub >

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

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found