Comments (9)
Does he Node module syntax not work for you?
from registry-js.
No.
It says 'Module did not self-register' if I use node module syntax.
My node version is 10.15.3
Electron version 6.0.3
from registry-js.
It says 'Module did not self-register' if I use node module syntax.
@yanlinsun I believe this is a different error, and I wrote some notes about understanding the issue over in atom/node-keytar#215 (comment) because I think your setup is leading to the wrong version being chosen by prebuild
.
from registry-js.
@shiftkey I tried the electron-rebuild but no luck. I even tried different registry-js versions, not working.
Actually, the node module requires syntax does working if I run 'renderer.js' with node. But it seems not working with electron.
I test using electron-quick-start project and registry-js only, I have attached the project. Also, there are logs of installing registry-js. Would you take a look? Thanks.
electron-quick-start.zip
from registry-js.
Actually, the node module requires syntax does working if I run 'renderer.js' with node. But it seems not working with electron.
This is unsurprising, because of mismatches between Node and Electron that aren't being handled correctly.
From the registry-js-1.8.0-install.log
file, here's the failure fo 1.8.0:
prebuild-install info begin Prebuild-install version 5.3.0
prebuild-install info looking for cached prebuild @ C:\Users\ysun\AppData\Roaming\npm-cache\_prebuilds\e4858a-registry-js-v1.8.0-node-v64-win32-x64.tar.gz
prebuild-install info found cached prebuild
prebuild-install info unpacking @ C:\Users\ysun\AppData\Roaming\npm-cache\_prebuilds\e4858a-registry-js-v1.8.0-node-v64-win32-x64.tar.gz
prebuild-install info unpack resolved to C:\Users\ysun\Workspaces\Private\electron-quick-start\node_modules\registry-js\build\Release\registry.node
prebuild-install WARN install Module did not self-register.
Notice how this is choosing registry-js-v1.8.0-node-v64-win32-x64.tar.gz - that's not the right file at all. The rest of the log is it trying to build the native module against node 10.15.3 which I guess is the version you have installed currently.
It's not clear to me how that you're using electron-rebuild
correctly - it needs to be run after installing any packages but before you launch the app. I think that's the missing part here.
from registry-js.
Failed attempts 1
I did run electron-rebuild right after I install registry-js, then run npm start
.
$ ./node_modules/.bin/electron-rebuild -f -v 6.0.3 -w registry-js
- Searching dependency tree
√ Rebuild Complete
But the error is still the same. I notice that the files in node_modules/registry-js
does not change at all after I run the electron-rebuild. I tried to run using electron-rebuild.cmd, not work either.
Failed attempts 2
I tried to rename the registry-js-v1.8.0-electron-v73-win32-x64.tar.gz to registry-js-v1.8.0-electron-v64-win32-x64.tar.gz. Then copy it into npm-cache/_prebuilds
folder and re-install registry-js in electron-quick-start project again. I am trying to fool the npm to use v73 instead of v64 and the "fool" is working according to the log. However, this does not solve the problem. I notice there is a warning message in the log.
> [email protected] install C:\Users\ysun\Workspaces\Private\electron-quick-start\node_modules\registry-js
> prebuild-install || node-gyp rebuild
prebuild-install info begin Prebuild-install version 5.3.0
prebuild-install info looking for cached prebuild @ C:\Users\ysun\AppData\Roaming\npm-cache\_prebuilds\e4858a-registry-js-v1.8.0-node-v64-win32-x64.tar.gz
prebuild-install info found cached prebuild
prebuild-install info unpacking @ C:\Users\ysun\AppData\Roaming\npm-cache\_prebuilds\e4858a-registry-js-v1.8.0-node-v64-win32-x64.tar.gz
prebuild-install info unpack resolved to C:\Users\ysun\Workspaces\Private\electron-quick-start\node_modules\registry-js\build\Release\registry.node
prebuild-install WARN install Module did not self-register. <--- WARNING message
C:\Users\ysun\Workspaces\Private\electron-quick-start\node_modules\registry-js>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp info it worked if it ends with ok
gyp verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli 'rebuild' ]
gyp info using [email protected]
gyp info using [email protected] | win32 | x64 <--- Building against node
Working version
After some tweak, I managed to get a working version. This is what I did.
- clone registry-js from github
npm run electron-prebuild
cp build/Release/registry.node ../electron-quick-start/node_modules/registry-js/build/Release
Then it finally worked in electron.
Update
The above only works in the electron-quick-start project, not working in my other project. I am working on it.
My other project works as well after I run npm update
. I think some part of the electron gets updated, as I can see some file changes in node_module/electron/dist
folder, even the electron --version
shows no difference after the update.
Conclusion
I believe this is because of the npm install
compiles the registry.node
against node, not electron. But how this happens I do not know. And the electron-rebuild seems not doing anything as the file in node_module/registry-js
never touched. Is there any setting wrong in my environment?
from registry-js.
I find out that the electron-rebuild only work if I put 'registry-js' in "dependencies" section in package.json. It does not work if I put it under 'devDependenies' section.
from registry-js.
I find out that the electron-rebuild only work if I put 'registry-js' in "dependencies" section in package.json. It does not work if I put it under 'devDependenies' section.
Aha, this is helpful context. Thanks for digging into it @yanlinsun!
from registry-js.
I didn't use the electron-rebuild correctly. By default, it looks for productive dependencies and rebuilds.
To use electron-rebuild for devDependencies
, use the following command:
./node_modules/.bin/electron-rebuild -t dev
from registry-js.
Related Issues (20)
- Editing the Registry HOT 1
- Add support for Electron 7 HOT 5
- Query 32-bit application data HOT 4
- c HOT 1
- Add support for Electron 8 and 9
- build error when add registry-js HOT 7
- Missing registry-js-v1.12.0-electron-v82-win32-x64.tar.gz? HOT 1
- src directory not included in package
- Undefined elements returned from enumerateValues
- Node-Gyp failure while packing registry.js on Electron App HOT 6
- Compare to regedit?
- Hi
- cool update
- Running install script, failed in 1.4s ... WARN install No prebuilt binaries found
- 37554b7ed95a1d6c59f94c73704afdf01dac24f4
- Looks great
- [email protected]
- Limit to win32
- git:/ 1:
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 registry-js.