Open bertyhell opened 3 years ago
Most likely you have 32-bit node. We only support 64-bit.
I installed vosk using the python command:
You don't need python for node module
ok, i reinstalled NodeJS x64 and now it works:
file: node-v16.13.0-x64.msi
thx for the help.
oeps, this worked because i tried it on another pc. On my laptop it still fails.
i tried reinstalling nodejs x64 on my laptop but it didn't help.
nodejs info:
> process
process {
version: 'v16.13.0',
versions: {
node: '16.13.0',
v8: '9.4.146.19-node.13',
uv: '1.42.0',
zlib: '1.2.11',
brotli: '1.0.9',
ares: '1.17.2',
modules: '93',
nghttp2: '1.45.1',
napi: '8',
llhttp: '6.0.4',
openssl: '1.1.1l+quic',
cldr: '39.0',
icu: '69.1',
tz: '2021a',
unicode: '13.0',
ngtcp2: '0.1.0-DEV',
nghttp3: '0.1.0-DEV'
},
arch: 'x64',
platform: 'win32',
release: {
name: 'node',
lts: 'Gallium',
sourceUrl: 'https://nodejs.org/download/release/v16.13.0/node-v16.13.0.tar.gz',
headersUrl: 'https://nodejs.org/download/release/v16.13.0/node-v16.13.0-headers.tar.gz',
libUrl: 'https://nodejs.org/download/release/v16.13.0/win-x64/node.lib'
},
_rawDebug: [Function: _rawDebug],
PATHEXT: '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW',
PROCESSOR_ARCHITECTURE: 'AMD64',
PROCESSOR_IDENTIFIER: 'Intel64 Family 6 Model 158 Stepping 10, GenuineIntel',
PROCESSOR_LEVEL: '6',
PROCESSOR_REVISION: '9e0a',
ProgramData: 'C:\\ProgramData',
ProgramFiles: 'C:\\Program Files',
'ProgramFiles(x86)': 'C:\\Program Files (x86)',
ProgramW6432: 'C:\\Program Files',
PROMPT: '$P$G',
PUBLIC: 'C:\\Users\\Public',
SESSIONNAME: 'Console',
SystemDrive: 'C:',
SystemRoot: 'C:\\WINDOWS',
TEMP: 'C:\\Users\\bert\\AppData\\Local\\Temp',
TMP: 'C:\\Users\\bert\\AppData\\Local\\Temp',
USERDOMAIN: 'DESKTOP-K9VNH6V',
USERDOMAIN_ROAMINGPROFILE: 'DESKTOP-K9VNH6V',
USERNAME: 'bert',
USERPROFILE: 'C:\\Users\\bert',
VS140COMNTOOLS: 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools',
windir: 'C:\\WINDOWS',
ZES_ENABLE_SYSMAN: '1'
},
title: 'C:\\Windows\\System32\\cmd.exe - node',
argv: [ 'C:\\Program Files\\nodejs\\node.exe' ],
execArgv: [],
pid: 6668,
ppid: 12488,
execPath: 'C:\\Program Files\\nodejs\\node.exe',
debugPort: 9229,
hrtime: [Function: hrtime] { bigint: [Function: hrtimeBigInt] },
argv0: 'node',
_preload_modules: [],
setSourceMapsEnabled: [Function: setSourceMapsEnabled],
[Symbol(kCapture)]: false
libvosk.dll info from dumpbin:
...\node_modules\vosk\lib\win-x86_64>dumpbin /ALL libvosk.dll
Microsoft (R) COFF/PE Dumper Version 14.29.30136.0
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file libvosk.dll
PE signature found
File Type: DLL
FILE HEADER VALUES
8664 machine (x64)
B number of sections
617DBBA6 time date stamp Sat Oct 30 23:39:50 2021
0 file pointer to symbol table
0 number of symbols
F0 size of optional header
222E characteristics
Executable
Line numbers stripped
Symbols stripped
Application can handle large (>2GB) addresses
Debug information stripped
DLL
OPTIONAL HEADER VALUES
20B magic # (PE32+)
2.31 linker version
151F400 size of code
17F4C00 size of initialized data
AA00 size of uninitialized data
1330 entry point (000000006F241330)
1000 base of code
6F240000 image base (000000006F240000 to 0000000070A45FFF)
1000 section alignment
200 file alignment
4.00 operating system version
0.00 image version
5.02 subsystem version
0 Win32 version
1806000 size of image
400 size of headers
17FCCF8 checksum
3 subsystem (Windows CUI)
160 DLL characteristics
High Entropy Virtual Addresses
Dynamic base
NX compatible
200000 size of stack reserve
1000 size of stack commit
100000 size of heap reserve
1000 size of heap commit
0 loader flags
10 number of directories
1687000 [ 171B63] RVA [size] of Export Directory
17F9000 [ 37BC] RVA [size] of Import Directory
0 [ 0] RVA [size] of Resource Directory
15D5000 [ 2D288] RVA [size] of Exception Directory
0 [ 0] RVA [size] of Certificates Directory
17FF000 [ 6884] RVA [size] of Base Relocation Directory
0 [ 0] RVA [size] of Debug Directory
0 [ 0] RVA [size] of Architecture Directory
0 [ 0] RVA [size] of Global Pointer Directory
158C000 [ 28] RVA [size] of Thread Storage Directory
0 [ 0] RVA [size] of Load Configuration Directory
0 [ 0] RVA [size] of Bound Import Directory
17F997C [ 8F0] RVA [size] of Import Address Table Directory
0 [ 0] RVA [size] of Delay Import Directory
0 [ 0] RVA [size] of COM Descriptor Directory
0 [ 0] RVA [size] of Reserved Directory
SECTION HEADER #1
.text name
151F328 virtual size
1000 virtual address (000000006F241000 to 0000000070760327)
151F400 size of raw data
400 file pointer to raw data (00000400 to 0151F7FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
60A00060 flags
Code
Initialized Data
RESERVED - UNKNOWN
RESERVED - UNKNOWN
Execute Read
The error when i execute the program in node:
> ts-node subtitle-syncer.ts ./example2/Alone-S02E05-Storm-Rising.mkv ./example2/Alone-S02E05-Storm-Rising.srt
C:\Users\...\subtitle-syncer\node_modules\ffi-napi\lib\dynamic_library.js:75
throw new Error('Dynamic Linking Error: ' + err);
^
Error: Dynamic Linking Error: Win32 error 127
at new DynamicLibrary (C:\Users\...\node_modules\ffi-napi\lib\dynamic_library.js:75:11)
at Object.Library (C:\Users\...\node_modules\ffi-napi\lib\library.js:47:10)
at Object.<anonymous> (C:\Users\...\node_modules\vosk\index.js:84:21)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Object.require.extensions.<computed> [as .js] (C:\Users\...\node_modules\ts-node\src\index.ts:1361:43)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
If i debug at the failure point:
I double checked that this file does exist:
C:\Users\...\subtitle-syncer\node_modules\vosk\lib\win-x86_64\libvosk.dll
Same Error over here
similar problem
same problem here
I had this error happen suddenly after I was running the Node.js (FFI) version of Vosk fine for more than a month.
After a thorough investigation, I found the cause!
It turns out that Anaconda adds ~\anaconda3\Library\mingw-w64\bin
to system path by default.
Depending on your installation, this directory may contain versions of the following DLLs, that could be incompatible with Vosk's:
libstdc++-6.dll
libwinpthread-1.dll
After rolling back an anaconda update for the scipy
package, which added the packages m2w64-gcc-libs-5.3.0-7
and m2w64-gcc-libs-core-5.3.0-7
, containing an incompatible version of the above DLLs, the problem got solved!
Seems like Vosk was resolving libstdc++-6.dll
and/or libwinpthread-1.dll
to the version from the anaconda path instead of from the local directory, this doesn't seem to be a desirable behavior and could break any time.
D:\Renorari\Documents\Works\vosk-test\node_modules\ffi-napi\lib\dynamic_library.js:75 throw new Error('Dynamic Linking Error: ' + err); ^
Error: Dynamic Linking Error: Win32 error 127
at new DynamicLibrary (D:\Renorari\Documents\Works\vosk-test\node_modules\ffi-napi\lib\dynamic_library.js:75:11)
at Object.Library (D:\Renorari\Documents\Works\vosk-test\node_modules\ffi-napi\lib\library.js:47:10)
at Object.
Node.js v18.13.0
@renorari do you have 32-bit nodejs by chance?
I have 64 bit node and have the same issue
I'm trying to get vosk to work inside nodeJS on Windows:
But i get this error:
I've already tried or read through the threads on:
I installed vosk using the python command:
And then also inside node:
My code is public on this repo: https://github.com/bertyhell/subtitle-syncer