Comments (12)
Can you just remove node-pre-gyp? tbh, that'd be far-and-away the easiest way to solve this problem
from rebuild.
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.
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.
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.
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.
Why doesn't this file just get overwritten?
from rebuild.
I have no idea
from rebuild.
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.
@cheton can you give my branch a test? I think this should do it
from rebuild.
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.
@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.
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)
- extraResources does not work as expected, nothing is copied HOT 1
- How can I tell electron-rebuild to ignore my library? HOT 4
- How to rebuild .node file without existing in a node_module?
- Error related to `.forge-meta` file HOT 1
- GCC_PREFIX_HEADER & GCC_PRECOMPILE_PREFIX_HEADER incompatible with Electron 20
- error rebuild canvas on Windows HOT 3
- Rebuilding node-canvas with electron-rebuild fails HOT 4
- Could not detect abi for version 22.3.3 and runtime electron. Updating "node-abi" might help solve this issue if it is a new release of electron at getAbi HOT 8
- no file node_modules/.bin/electron-rebuild in 3.2.11 HOT 1
- Error when rebuilding node-java package HOT 1
- Python 2 died 1,259 days ago on 1/1/2020. Why still use it? HOT 1
- Cross Compile on Linux
- Help using rebuild to package node-sqlite3 to use with Electron HOT 2
- ERR_REQUIRE_ESM HOT 1
- Follow OS conventions for storing cache
- it is not rebuilding for electron from the package root HOT 2
- need to upgrade node-gyp HOT 6
- Complains for deprecated move-file
- @electron/rebuild ignores symlinks for native modules, which crashes the application HOT 1
- Module build fails with empty binding.gyp HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rebuild.