deasync icon indicating copy to clipboard operation
deasync copied to clipboard

deasync: Could not locate the bindings file

Open atlas340 opened this issue 2 years ago • 10 comments

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.

atlas340 avatar Aug 02 '23 13:08 atlas340

I think deasync is compatible upto Node v18.

aakash14goplani avatar Sep 10 '23 07:09 aakash14goplani

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.

SheldonWBM avatar Sep 14 '23 20:09 SheldonWBM

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!

atlas340 avatar Sep 15 '23 19:09 atlas340

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:

  • https://nodejs.org/de/blog/announcements/v20-release-announce#v8-113
  • https://chromestatus.com/feature/5144156542861312

tskarman avatar Oct 14 '23 11:10 tskarman

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:

  • https://nodejs.org/de/blog/announcements/v20-release-announce#v8-113
  • https://chromestatus.com/feature/5144156542861312

I just noticed this commit that addressed some white-space issues: https://github.com/abbr/deasync/commit/b12bcb73bc2f27c8aa2fe04eb05196b74a274df8

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 avatar Oct 14 '23 11:10 tskarman

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.

tskarman avatar Oct 14 '23 11:10 tskarman

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

dhffdh avatar Nov 27 '23 13:11 dhffdh

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

SheldonWBM avatar Jan 02 '24 19:01 SheldonWBM