Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deasync: Could not locate the bindings file #179

Open
atlas340 opened this issue Aug 2, 2023 · 10 comments
Open

deasync: Could not locate the bindings file #179

atlas340 opened this issue Aug 2, 2023 · 10 comments

Comments

@atlas340
Copy link

atlas340 commented Aug 2, 2023

Description

I am trying to use the deasync package in my project, but I am getting the following error:

Error: Could not locate the bindings file. Tried:
→ .../node_modules/deasync/build/deasync.node
→ .../node_modules/deasync/build/Debug/deasync.node
→ .../node_modules/deasync/build/Release/deasync.node
→.../node_modules/deasync/out/Debug/deasync.node
→.../node_modules/deasync/Debug/deasync.node
→ .../node_modules/deasync/out/Release/deasync.node
→.../node_modules/deasync/Release/deasync.node
→.../node_modules/deasync/build/default/deasync.node
→ .../node_modules/deasync/compiled/20.5.0/linux/x64/deasync.node
→ .../node_modules/deasync/addon-build/release/install-root/deasync.node
→ .../node_modules/deasync/addon-build/debug/install-root/deasync.node
→.../node_modules/deasync/addon-build/default/install-root/deasync.node
→.../node_modules/deasync/lib/binding/node-v115-linux-x64/deasync.node

I am using Node.js v20.5.0. I have tried reinstalling the deasync package, but the error persists.

Steps to Reproduce

  1. Install the deasync package.
  2. Try to import the deasync module.
  3. Get the error.

Expected Behavior

The deasync module should be imported successfully and I should be able to use it in my code.

Actual Behavior

I get the error message "Could not locate the bindings file".

Possible Solutions

  • The deasync package may not be compatible with Node.js v20.5.0.
  • The deasync package may not have been installed correctly.
  • There may be a problem with my Node.js installation.

I hope this information is helpful. Thank you for your time.

@aakash14goplani
Copy link

I think deasync is compatible upto Node v18.

@SheldonWBM
Copy link

SheldonWBM commented Sep 14, 2023

This issue also occurs in Node v20.6.1 but does not occur in v18.17.1
Node v20 will be Active-LTS on 2023-10-24

Opening the generated log file, we find that the error is related to #181 please run "yarn add node-gyp" into your top-level workspace.

@atlas340
Copy link
Author

That's good to know. It seems that Node v20.6.1 might need some attention before it becomes Active-LTS. Thanks for sharing that information!

@tskarman
Copy link

I just noticed that the auto-generated deasync.vcxproj file contains invalid local paths.

<AdditionalIncludeDirectories>C:\Users\someuser\AppData\Local\node-gyp\Cache\20.8.1\include\node;C:\Users\someuser\AppData\Local\node-gyp\Cache\20.8.1\src;C:\Users\someuser\AppData\Local\node-gyp\Cache\20.8.1\deps\openssl\config;C:\Users\someuser\AppData\Local\node-gyp\Cache\20.8.1\deps\openssl\openssl\include;C:\Users\someuser\AppData\Local\node-gyp\Cache\20.8.1\deps\uv\include;C:\Users\someuser\AppData\Local\node-gyp\Cache\20.8.1\deps\zlib;C:\Users\someuser\AppData\Local\node-gyp\Cache\20.8.1\deps\v8\include;C:\Users\someuser\Dev\Repos\company\ClientSource\apps\ eatingplanner\node_modules\node-addon-api;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

The invalid part in:

;C:\Users\someuser\Dev\Repos\company\ClientSource\apps\ eatingplanner\node_modules\node-addon-api;

is the sequence \ eatingplanner.
It should be \seatingplanner.

;C:\Users\someuser\Dev\Repos\company\ClientSource\apps\seatingplanner\node_modules\node-addon-api;

Meaning that some logic replaced \s with \ .

I wouldn't be too surprised if this was due to some breaking change around regular expressions.
Node v20 release notes mention some RegExp changes:

@tskarman
Copy link

I just noticed that the auto-generated deasync.vcxproj file contains invalid local paths.

<AdditionalIncludeDirectories>C:\Users\someuser\AppData\Local\node-gyp\Cache\20.8.1\include\node;C:\Users\someuser\AppData\Local\node-gyp\Cache\20.8.1\src;C:\Users\someuser\AppData\Local\node-gyp\Cache\20.8.1\deps\openssl\config;C:\Users\someuser\AppData\Local\node-gyp\Cache\20.8.1\deps\openssl\openssl\include;C:\Users\someuser\AppData\Local\node-gyp\Cache\20.8.1\deps\uv\include;C:\Users\someuser\AppData\Local\node-gyp\Cache\20.8.1\deps\zlib;C:\Users\someuser\AppData\Local\node-gyp\Cache\20.8.1\deps\v8\include;C:\Users\someuser\Dev\Repos\company\ClientSource\apps\ eatingplanner\node_modules\node-addon-api;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

The invalid part in:

;C:\Users\someuser\Dev\Repos\company\ClientSource\apps\ eatingplanner\node_modules\node-addon-api;

is the sequence \ eatingplanner. It should be \seatingplanner.

;C:\Users\someuser\Dev\Repos\company\ClientSource\apps\seatingplanner\node_modules\node-addon-api;

Meaning that some logic replaced \s with \ .

I wouldn't be too surprised if this was due to some breaking change around regular expressions. Node v20 release notes mention some RegExp changes:

I just noticed this commit that addressed some white-space issues: b12bcb7

And then I tried downgrading from [email protected] to [email protected].
And yes, after doing that downgrade, I could successfully install deasync even on Node v20.

@tskarman
Copy link

And looking at the original issue description, my problem likely was a different one.
I would expect my problem to only occur when a folder name starts with s.
Anyway. I'll mention some more keywords here for others to find. The original error mentioned a missing napi.h file.

@dhffdh
Copy link

dhffdh commented Nov 27, 2023

Try cp node_modules/deasync/bin/darwin-arm64-node-20/deasync.node node_modules/deasync/build/deasync.node.
It helped me

@SheldonWBM
Copy link

After bumping deasync to version 0.1.29, Node v20 seems to be fully supported.

@Mrgaton
Copy link

Mrgaton commented Nov 28, 2024

same exception

@SheldonWBM
Copy link

SheldonWBM commented Nov 29, 2024

@Mrgaton, this error occurred in a project that used the development package eslint-plugin-postcss-modules. That plugin was last updated 3 years ago. I added deasync to "resolutions" in the package.json to force it to use an updated, patched version. Had no issues. However, between Jan 2nd, 2023 and today, I upgraded ESLint to the latest version and switched packages to eslint-plugin-css-modules. Hopefully, it will be maintained. Overall, the linting is faster. The alternative plugin does not have desync as a dependency. It works for SCSS modules.

Note: the maintainer had "moved on to using css-in-js libraries like styled-components and emotion." However, he removed that notice from the readme and updated it. He had a change of heart on a project and returned to maintaining it.

Opinion: I have used styled-components and CSS modules. Due to performance issues with styled-components, i.e. syntax errors not being caught even during runtime but slowing the application, I avoid inline CSS, especially if it needs to be wrapped in a string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants