Rebuilding native modules directory naming issue
See original GitHub issueWhen rebuilding with the serialport module, it names the final directory as
electron-v0.34.1-darwin-x64
However, when ran with the executable, it is looking for
node-v46-darwin-x64
It seems like in main.js, the directory name and electron versioning is mixed.
Issue Analytics
- State:
- Created 8 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Rebuilding native modules directory naming issue #33 - GitHub
Rebuilding native modules directory naming issue #33 ... It seems like in main.js, the directory name and electron versioning is mixed.
Read more >Building native modules as part of electron app - Stack Overflow
The first issue I am running into is the module requires to be manually built by going into the director and manually running...
Read more >Troubleshooting | React Navigation
If the module points to a local file (i.e. the name of the module starts with ./ ), then it's probably due to...
Read more >rollup.js
The file should export a function returning a plugin object. Via the name of a plugin that is installed in a local or...
Read more >electron-rebuild - npm Package Health Analysis - Snyk
Electron supporting package to rebuild native node modules against the currently installed electron For more information about how to use this package see ......
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 FreeTop 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
Top GitHub Comments
I have exactly the same problem with sqlite3.
For information: After having installed sqlite and electron-rebuild I did :
./node_modules/.bin/electron-rebuild
and it created a .node file atnode_modules/sqlite3/lib/binding/electron-v0.36-darwin-x64/node_sqlite3.node
. But electron give this error “Uncaught Error: Cannot find module '/Users/me/dev/proj/node_modules/sqlite3/lib/binding/node-v47-darwin-x64/node_sqlite3.node’”I renamed the folder to
node-v47-darwin-x64
and it worked.Note that in
node_modules/sqlite3/build/config.gypi
I have the right pathand
node_modules/sqlite3/package.json
PS: This command work (because module_path hard coded):
cd node_modules/sqlite3 && node-gyp rebuild --target=0.36.1 --arch=x64 --target_platform=darwin --runtime=electron --module_name=node_sqlite3 --module_path=../lib/binding/node-v47-darwin-x64
This is now solved upstream by https://github.com/mapbox/node-pre-gyp/pull/187 - available in node-pre-gyp >= 0.6.25. So, the next step is to ensure that modules you are using that depend and bundle node-pre-gyp get re-tagged with the latest version.