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.

deasync not working under Electron 1.3.2

See original GitHub issue

On attempting to use deasync w/ electron-prebuilt@1.3.2, node v4.4.7 on Linux Mint 18, it throws an error:

(bindings.js:91) Uncaught Error: Could not locate the bindings file. Tried:
 → /(path to project)/node_modules/deasync/build/deasync.node
 → /(path to project)/node_modules/deasync/build/Debug/deasync.node
 → /(path to project)/node_modules/deasync/build/Release/deasync.node
 → /(path to project)/node_modules/deasync/out/Debug/deasync.node
 → /(path to project)/node_modules/deasync/Debug/deasync.node
 → /(path to project)/node_modules/deasync/out/Release/deasync.node
 → /(path to project)/node_modules/deasync/Release/deasync.node
 → /(path to project)/node_modules/deasync/build/default/deasync.node
 → /(path to project)/node_modules/deasync/compiled/6.3.0/linux/x64/deasync.node
    at bindings (/(path to project)/node_modules/deasync/node_modules/bindings/bindings.js:88:9)
    at /(path to project)/node_modules/deasync/index.js:34:32
    at Object.<anonymous> (/(path to project)/node_modules/deasync/index.js:76:2)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)bindings @ bindings.js:88(anonymous function) @ index.js:34(anonymous function) @ index.js:76Module._compile @ module.js:541Module._extensions..js @ module.js:550Module.load @ module.js:458tryModuleLoad @ module.js:417Module._load @ module.js:409Module.require @ module.js:468require @ internal/module.js:20(anonymous function) @ VM116:1

However, deasync works fine when using it in a normal nodejs (still v4.4.7) context.

(Similar to #47 but not on Windows - not sure if same issue so I opened a new issue)

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:10

github_iconTop GitHub Comments

2reactions
obermillerkcommented, Sep 27, 2017

This is really frustrating. I’m trying to make a module that I will use in an electron app and I can’t manually rebuild deasync every time because I want to be able to just require my module as a dependency without the user having to do more work.

EDIT: UNRELIABLE, SEE BELOW I found a workaround where instead of actually making deasync a dependency, I install it in the postinstall script of my module and then use npm explore to find deasync’s install and rebuild using node-gyp. "postinstall": "npm install -E deasync@0.1.10 && npm explore deasync -- node-gyp rebuild" I had to do it this way since there doesn’t seem to be a guarantee that deasync will be installed before my library so I can’t just make it a dependency and then do only the rebuild in the postinstall.

It would be great to take advantage of the prebuilt binaries to save that time, but they’re not in the right place. Is there any detriment to having the corresponding folder be copied as a build folder in the root on install (even a sym-link, perhaps preferably a sym-link)? This would make it compatible with electron and still take advantage of prebuilt-binaries.

EDIT: I just tested both the copy and sym-link methods and it didn’t work so I redact that suggestion but a fix for this would still be greatly appreciated.

0reactions
obermillerkcommented, Sep 27, 2017

@RedDuckss I don’t quite recall, but I may have run into that as well, otherwise it might be something else. What I ended up doing instead was modifying the deasync library so that it doesn’t use the prebuilts and instead rebuilds for the local node version on install. Then I could pack it in a tar file, upload that somewhere (such as part of a github repo) and install from that. It would still have to be rebuilt again for electron, but I would think that would be part of your process already.

Here is a zip file containing a tarball of my modified deasync library, with build script and prebuilt binaries removed since they are no longer needed. deasync-0.1.10-custom.zip

EDIT: You can install from the tarball by giving npm a relative path such as npm i ../custom_modules/deasync-0.1.10-custom.tgz If you’re using this in a module you want to publish to npm, you can install from the tarball and then add deasync as a bundledDependency by adding "bundledDependencies": ["deasync"] to your package.json, and when you do npm publish it packs the locally installed version of deasync with your module and it will install it as a sub-module when your package is installed from npm.

EDIT 2: Also note that if you want to install from the tarball when your module is pulled from npm rather than making it a bundledDependency, you cannot rely on the tarball file being present as a local file, you should instead point to it being hosted remotely somewhere. This last one could be risky if your host goes down, so I’d recommend the bundled approach as they will get everything from npm (or nothing at all).

Read more comments on GitHub >

github_iconTop Results From Across the Web

npm deasync cause crash in electron - node.js - Stack Overflow
Problem description: The usage of "deasync" node module (version 0.1.11 and also 0.1.12) causes the crash of the renderer process. In electron ......
Read more >
could not locate the bindings file deasync
On attempting to use deasync w/ electron-prebuilt@1.3.2, node v4.4.7 on Linux Mint 18, it throws an error: (bindings.js:91) Uncaught Error: Could not locate...
Read more >
Dell Wyse Management Suite Version 3.1 Third Party Licenses
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,...
Read more >
deasync - npm
If all you are facing is syntactic problem such as callback hell, using a less drastic package implemented in pure js is recommended....
Read more >
Compare Versions | @mega-apps/cli - Open Source Insights
GHSA-gxpj-cx7g-858cRegular Expression Denial of Service in debug ... GHSA-282f-qqgm-c34qPrototype Pollution in node-jsonpointer ... @types/mime 1.3.2.
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