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

VOSK not compatible with newer NodeJS Versions because of ffi-napi dependency #1613

Open
johnseabird opened this issue Jul 26, 2024 · 8 comments

Comments

@johnseabird
Copy link

I do have the issue that VOSK will only run in older NodeJS versions, since ffi-napi package seems to be incompatible with newer node versions 18.7^ .

This was tested on multiple windows 11 machines as well as within Debian Bookworm (Docker Dev Container)

Reproduce:

nvm install 18.7
nvm use 18.7
npm install vosk -> ERRORs

nvm install 18.4
nvm use 18.4
npm install vosk -> SUCCESS

nvm install 18.7
nvm use 18.7
npm install ffi-napi -> ERRORs

nvm install 18.4

nvm use 18.4
npm install ffi-napi -> SUCCESS

To isolate this: If I try to install ffi-napi without vosk in for example Node 18.7^ , I already get errors and ffi-napi can not be installed anymore. Since VOSK depends on ffi-napi, VOSK will fail to install on those versions.

Is there anyway to use a maintained dependency instead of ffi-napi? ffi-napi isn't maintained in years.
Would ffi-rs be an alternative to use here?

2024-07-26T09_04_45_570Z-debug-0.log

@nshmyrev
Copy link
Collaborator

We need to write direct bindings for node. I think ff-napi is hopeless.

@Fyphen1223
Copy link

Are there any solutions for this :(

I really need to use VOSK with Node.js v21.

@johnseabird
Copy link
Author

We need to write direct bindings for node. I think ff-napi is hopeless.

Is there a roadmap for when this might happen?
We currently develop a server application at work and VOSK is an important part in our pipeline to stay in the area of acceptable delays.

@johnseabird
Copy link
Author

Are there any solutions for this :(

I really need to use VOSK with Node.js v21.

What seems to work is, install VOSK with an older node version and switch to a high node version afterwards.

So:
nvm install 18.4
nvm use 18.4
npm install vosk (with node 18.4 for example)
nvm install 21
nvm use 21
npm start

Not sure if that might have any other issues later on. but so far it works. it is pretty inconvenient for deployment but does the trick during development.

@Fyphen1223
Copy link

Actually, I'm depending on pnpm - which is not compatible with version <18.12.

@johnseabird
Copy link
Author

Actually, I'm depending on pnpm - which is not compatible with version <18.12.

I see - what might be an option is to use an old version of node with npm to just install vosk in an empty folder and copy the contents of the node_module into the pnpm contents folder somehow? Since the issue is the binding step with ffi-napi. so if vosk package is once installed and bindings / c++ are successfull, it works by copy pasting (in theory)

@Fyphen1223
Copy link

Actually, I'm depending on pnpm - which is not compatible with version <18.12.

I see - what might be an option is to use an old version of node with npm to just install vosk in an empty folder and copy the contents of the node_module into the pnpm contents folder somehow? Since the issue is the binding step with ffi-napi. so if vosk package is once installed and bindings / c++ are successfull, it works by copy pasting (in theory)

Oh, that was not in my mind - let me have a minute and try it.

@Fyphen1223
Copy link

Well, I think it's working!
Thanks for the solution!

(for just a reference, I created a new folder and nvm to use the older node and npm. Then used them to install vosk, and using cp command copied everything into the working node_modules. The problem is that now it requires weird steps to use lmao)

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

No branches or pull requests

3 participants