Closed woodbri closed 2 weeks ago
Two notes:
I've simplified the test case to:
npm install sqlite@5.1.7
node -e 'require("sqlite3")'
node:internal/modules/cjs/loader:1464
return process.dlopen(module, path.toNamespacedPath(filename));
^
Error: A dynamic link library (DLL) initialization routine failed.
\\?\C:\msys64\home\woodbri\work\test-sqlite3\node_modules\sqlite3\lib\binding\napi-v6-win32-unknown-
x64\node_sqlite3.node
at Module._extensions..node (node:internal/modules/cjs/loader:1464:18)
at Module.load (node:internal/modules/cjs/loader:1205:32)
at Module._load (node:internal/modules/cjs/loader:1021:12)
at Module.require (node:internal/modules/cjs/loader:1230:19)
at require (node:internal/modules/helpers:179:18)
at Object.<anonymous> (C:\msys64\home\woodbri\work\test-sqlite3\node_modules\sqlite3\lib\sqlite3
-binding.js:4:17)
at Module._compile (node:internal/modules/cjs/loader:1368:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1426:10)
at Module.load (node:internal/modules/cjs/loader:1205:32)
at Module._load (node:internal/modules/cjs/loader:1021:12) {
code: 'ERR_DLOPEN_FAILED'
}
Node.js v21.7.2
I've also tried this with sqlite3 versions 5.1.5, 5.1.6, and 5.1.7 and get the same results. Yes looked at the package site and see various similar problems and tried various work-a-rounds.
This is such a simple test and I find it hard to believe that no one can run sqlite3 in nodejs in msys2/mingw64 environment.
Same issue using --import=sqlite3
$ node --import=sqlite3
node:internal/modules/cjs/loader:1464
return process.dlopen(module, path.toNamespacedPath(filename));
^
Error: A dynamic link library (DLL) initialization routine failed.
\\?\C:\msys64\home\woodbri\work\test-sqlite3\node_modules\sqlite3\lib\binding\napi-v6-win32-unknown-
x64\node_sqlite3.node
at Module._extensions..node (node:internal/modules/cjs/loader:1464:18)
at Module.load (node:internal/modules/cjs/loader:1205:32)
at Module._load (node:internal/modules/cjs/loader:1021:12)
at Module.require (node:internal/modules/cjs/loader:1230:19)
at require (node:internal/modules/helpers:179:18)
at Object.<anonymous> (C:\msys64\home\woodbri\work\test-sqlite3\node_modules\sqlite3\lib\sqlite3
-binding.js:4:17)
at Module._compile (node:internal/modules/cjs/loader:1368:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1426:10)
at Module.load (node:internal/modules/cjs/loader:1205:32)
at Module._load (node:internal/modules/cjs/loader:1021:12) {
code: 'ERR_DLOPEN_FAILED'
}
Node.js v21.7.2
I installed sqlite3 with
pacman -S mingw-w64-x86_64-sqlite3
and this seems to get rid is DLL loading error but is now goes back to the original error
$ node inspect -e 'require("sqlite3")'
< Debugger listening on ws://127.0.0.1:9229/45ec13d8-2c3d-445c-8f04-d7370eefbd82
< For help, see: https://nodejs.org/en/docs/inspector
<
connecting to 127.0.0.1:9229 ... ok
Break on start in [eval]:1
> 1 require("sqlite3")
debug> n
debug> There was an internal error in Node.js. Please report this bug.
read ECONNRESET
Error: read ECONNRESET
at TCP.onStreamRead (node:internal/stream_base_commons:217:20)
at TCP.callbackTrampoline (node:internal/async_hooks:130:17)
node:events:497
throw er; // Unhandled 'error' event
^
Error: kill EPERM
at ChildProcess.kill (node:internal/child_process:512:26)
at process.handleUnexpectedError (node:internal/debugger/inspect:360:42)
at process.emit (node:events:531:35)
at process.emit (node:domain:488:12)
at process._fatalException (node:internal/process/execution:178:25)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess.kill (node:internal/child_process:512:12)
at process.handleUnexpectedError (node:internal/debugger/inspect:360:42)
[... lines matching original stack trace ...]
at process._fatalException (node:internal/process/execution:178:25) {
errno: -4048,
code: 'EPERM',
syscall: 'kill'
}
Node.js v21.7.2
SO, this is clearly not a programming issue. It appears to be an issue between nodejs and sqlite3. I've reported this on both sites but am totally stuck in the water!
This appears to be an issue with a specific package. Please report to them and obtain more information about whether this is actually a problem with node before reporting an issue
Thank you
Node.js Version
v21.7.2
NPM Version
10.5.0
Operating System
MINGW64_NT-10.0-19045 DESKTOP-MD7Q6H6 3.5.3.x86_64 2024-05-06 06:45 UTC x86_64 Msys
Subsystem
Other
Description
I can not get sqlite3 5.1.7 to import or require into a script. It throws a kill. I have tried multiple way of doing this with no success.
Minimal Reproduction
Alternatively using "type": "module" in package.json
Output
Before You Submit