melchor629 / node-flac-bindings

Nodejs bindings to libFLAC
ISC License
17 stars 1 forks source link

prebuild-install WARN install No prebuilt binaries found (target=12.18.0 runtime=node arch=x64 libc= platform=win32) #15

Closed cerbaire closed 3 years ago

cerbaire commented 4 years ago

Could you please document which prebuilt binaries are available for download ? (I am on Windows 10 1909 x64) And which version of Node are supported ? (I am using 12.18, and tested with 8, 10 and 12.14)

I have many warning while installing (compiling) flac-bindings:

D:\GitHub\Project\node_modules\flac-bindings\build_deps\flac-src\src\libFLAC\format.c(580): warning C4334: '<<' : résultat du décalage 32 bits converti implicitement en 64 bits (le décalage 64 bits est-il intentionnel ?) [D:\GitHub\Project\node_modules\flac-bindings\build_deps\flac-build\src\libFLAC\FLAC.vcxproj]

D:\GitHub\Project\node_modules\flac-bindings\build_deps\flac-src\src\libFLAC\metadata_iterators.c(579): warning C4244: 'return' : conversion de 'const __int64' en 'off_t', perte possible de données [D:\GitHub\Project\node_modules\flac-bindings\build_deps\flac-build\src\libFLAC\FLAC.vcxproj]

D:\GitHub\Project\node_modules\flac-bindings\build_deps\flac-src\src\libFLAC\window.c(71): warning C4244: 'fonction' : conversion de 'double' en 'float', perte possible de données [D:\ GitHub\Project\node_modules\flac-bindings\build_deps\flac-build\src\libFLAC\FLAC.vcxproj]

Then, when executing simple code : const it = new flac.api.SimpleIterator() it.init(fullPath, false, false) it.status() return 2: ERROR_OPENING_FILE

Any suggestions ?

melchor629 commented 4 years ago

Hello, I see there is some error when calling to prebuild-install, which is not downloading the right file. The package uses NAPI 4 or 6 (see link for the supported versions), but the script is not downloading any of the packages. Windows is supported in the list. I will create a new version quick to fix this.

Warnings during compilation are mainly the MSVC compiler complaining about things it should not worry about, on macOS and Linux, there are no warnings at all :/

About your code, I cannot say anything more than check the path (check if the path is using \ correctly, the path points to a valid file...). From time to time I run all the tests on Windows and almost all passes. There are some random failures due to how Windows manages file access, which raises some useless errors 😞 I will try to run them again just in case.

Will update later today. Thanks for raising the issue.

melchor629 commented 4 years ago

Hi, I just updated the package with the fix for the prebuilt package download. I tried to install the package from an empty node project on macOS and Windows and both seem to work now (give it a try):

➜ npm install flac-bindings
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

> flac-bindings@2.4.1 install /Users/.../node_modules/flac-bindings
> node scripts/flac-build.js

> prebuild-install -r napi

+ flac-bindings@2.4.1
added 182 packages from 186 contributors and audited 182 packages in 11.429s

4 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

Also tried to run the tests on Windows again and just same random errors due to Windows and the locks on files. SimpleIterator tests run almost all without trouble :/

cerbaire commented 4 years ago

Hello, Thx ! It works great. Instant install. Thanks for quick fixing this. Really appreciate.

Regarding ERROR_OPENING_FILE error, it was due to a path of more than 260, not supported by the library. I will try to find another way to manage these files

melchor629 commented 4 years ago

Hello, glad to hear it also works for you :)

Regarding the path limitation, maybe it has something to do with the flac library itself, I don't know (Windows is not my main platform). If you know something I could try to avoid this...

So, if you think it is everything ok now, feel free to close the issue

cerbaire commented 3 years ago

Hello, I have the issue today with flac-bindings v2.5 and v2.6, and node v12 or v14. I am using node 14.15.5 (npm 7.5.4). Could you have a look a it ? (It is still working with node v10 and flac-bindings 2.4.1 or 2.5.0)

melchor629 commented 3 years ago

Hello, I just test a fresh install using node 12.20.2 with npm 6.14.11 and node 14.15.5 with npm 7.5.4 on Windows 10 (both in 64-bit, 32-bit node is not supported on Windows). Both versions managed to install and download the prebuilt binary. Also, one thing to note is the version 2.6 has just been released and I think it was not available when you re-opened the issue (I'm not sure about this timing). This version added support for node 14.x and 15.x. If possible, could you provide some logs, which is the error or warning that shows in the terminal...

cerbaire commented 3 years ago

Hello, I think I found the root cause of the problem. I had multiple installation of node on my machine and was renaming the nodejs folder to activate one or another. In this scenario, it generates an error 'N-API version undefined' and lead to a compilation of the source code. Sorry to not see that before reopening the ticket. And yes, 2.6.0 was just online when I tested. Seems we have our spare time on Saturday evening, and you just release a version while I npmed install my project.

melchor629 commented 3 years ago

Hi, a bit weird the root cause of the problem... Good to know it is fixed. And yep, Saturday sometimes is a good day for advancing personal projects hehe