Giter VIP home page Giter VIP logo

Comments (12)

anaisbetts avatar anaisbetts commented on July 28, 2024 1

Can you just remove node-pre-gyp? tbh, that'd be far-and-away the easiest way to solve this problem

from rebuild.

cheton avatar cheton commented on July 28, 2024 1

I ran this command from node_modules, and it reported that serialport.node already installed.

$ node electron-rebuild/node_modules/npm/bin/npm-cli.js rebuild serialport \
    --runtime=electron \
    --target=0.37.6 \
    --arch=x64 \
    --dist-url=https://atom.io/download/atom-shell

> [email protected] install /Users/cheton/github/cnc/node_modules/serialport
> node-pre-gyp install --fallback-to-build

[serialport] Success: "/Users/cheton/github/cnc/node_modules/serialport/build/Release/serialport.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
[email protected] /Users/cheton/github/cnc/node_modules/serialport

Passing the --update-binary option works for me, it can overwrite a pre-installed build/Release/serialport.node.

> [email protected] install /Users/cheton/github/cnc/node_modules/serialport
> node-pre-gyp install --fallback-to-build

gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
  CXX(target) Release/obj.target/serialport/src/serialport.o
  CXX(target) Release/obj.target/serialport/src/serialport_unix.o
  CXX(target) Release/obj.target/serialport/src/serialport_poller.o
  SOLINK_MODULE(target) Release/serialport.node
[email protected] /Users/cheton/github/cnc/node_modules/serialport

I believe you can add the --update-binary option to the rebuildNativeModules function to make it work: https://github.com/electron/electron-rebuild/blob/master/src/main.js#L122

Hope this information will help you!

from rebuild.

reconbot avatar reconbot commented on July 28, 2024

Most Windows users don't have an environment to build binary packages.
That's not an option.

The local build on install make a binary in the same place anyway.

On Sun, Apr 10, 2016, 2:14 PM Paul Betts [email protected] wrote:

Can you just remove node-pre-gyp? tbh, that'd be far-and-away the easiest
way to solve this problem


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#59 (comment)

from rebuild.

anaisbetts avatar anaisbetts commented on July 28, 2024

node-pre-gyp isn't a tenable solution anymore - people happened to get away with it because there weren't that many node versions out in practice (everyone was on 0.12, basically) - but now that node is always coming out with new versions that people will be using, node itself is now in the same sitch as Electron always has been - that there are too many versions of V8 to practically support via node-pre-gyp. This is only going to get worse, and not just for Electron.

from rebuild.

reconbot avatar reconbot commented on July 28, 2024

It's been working fine for us, we've got the node abi version (process.versions.modules) in the pre build's path which keeps it working fine for the different versions. We don't have a prebuild for electron and that's ok. (Even though I wouldn't mind prebuilding for electron.)

Assuming we didn't use node-pre-gyp, when a user runs npm install serialport we'd build a binary and put it in build/Release/serialport.node and it would be compiled with whatever node they are using. When users then ran electron rebuild they'd be in the exact same place as if node-pre-gyp downloaded the file and put it there. Unless I'm missing something?

from rebuild.

anaisbetts avatar anaisbetts commented on July 28, 2024

Why doesn't this file just get overwritten?

from rebuild.

reconbot avatar reconbot commented on July 28, 2024

I have no idea

from rebuild.

MarshallOfSound avatar MarshallOfSound commented on July 28, 2024

Resolution for this issue would be to add the given flag to our spawned rebuilder.

PR's welcome or I'll do it when I get some time 👍

from rebuild.

reconbot avatar reconbot commented on July 28, 2024

@cheton can you give my branch a test? I think this should do it

from rebuild.

cheton avatar cheton commented on July 28, 2024

Not sure what have been changed in recent versions. It seems the --update-binary option is no longer necessary when using npm v3.10.8 and electron-rebuild v1.2.1. It just works as expected.

from rebuild.

reconbot avatar reconbot commented on July 28, 2024

@cheton you mean it overwrites the binary? I couldn't confirm a change with npm 3.10.3 with our without the patch

from rebuild.

cheton avatar cheton commented on July 28, 2024

Hi @reconbot,

Yes, you're right. I found something wrong in my script, the --update-binary option is still necessary to overwrite an existing binary file. Thanks for your PR.

from rebuild.

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.