node-sqlserver-v8
node-sqlserver-v8 copied to clipboard
Error: Module did not self-register
Hello! I'm trying to use this library to enable Windows authentication, and it refuses to build for me. After reviewing some of the other issues, I tried using prebuild-install
as suggested.
Here are the steps I took.
My Node.js version:
PS C:\Users\me\app\server> fnm current
v18.14.1
Added msnodesqlv8 (edited for brevity):
PS C:\Users\me\app\server> yarn add msnodesqlv8
➤ YN0000: ┌ Resolution step
➤ YN0032: │ msnodesqlv8@npm:3.0.1: Implicit dependencies on node-gyp are discouraged
➤ YN0032: │ nan@npm:2.17.0: Implicit dependencies on node-gyp are discouraged
➤ YN0000: └ Completed in 0s 785ms
➤ YN0000: ┌ Post-resolution validation
➤ YN0000: └ Completed
➤ YN0013: │ msnodesqlv8@npm:3.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ nan@npm:2.17.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0000: └ Completed in 0s 883ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed in 4s 795ms
➤ YN0000: Done with warnings in 6s 830ms
I then ran a version of the following script:
const sql = require('mssql');
const windowsDriver = require('mssql/msnodesqlv8');
const config = {
driver: windowsDriver,
server: 'localhost',
port: 63667,
database: 'NodeTypeORM',
options: {
trustedConnection: true,
useUTC: true
}
}
sql.connect(config).then((pool) => {
console.log('cnnected');
return pool.request().query('select firstname, lastname from Users').then(res => {
console.log(res);
})
}).catch(error=> console.log('cant connect\n'+error));
And the error occurred at this point:
PS C:\Users\me\app\server> node .\connection-test.js
node:internal/modules/cjs/loader:1338
return process.dlopen(module, path.toNamespacedPath(filename));
^
Error: Module did not self-register: '\\?\C:\Users\me\app\server\node_modules\msnodesqlv8\build\Release\sqlserverv8.node'.
at Module._extensions..node (node:internal/modules/cjs/loader:1338:18)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Module._load (node:internal/modules/cjs/loader:958:12)
at Module.require (node:internal/modules/cjs/loader:1141:19)
at require (node:internal/modules/cjs/helpers:110:18)
at C:\Users\me\app\server\node_modules\msnodesqlv8\lib\connection.js:10:21
at Object.<anonymous> (C:\Users\me\app\server\node_modules\msnodesqlv8\lib\connection.js:577:3)
at Module._compile (node:internal/modules/cjs/loader:1254:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Module.load (node:internal/modules/cjs/loader:1117:32) {
code: 'ERR_DLOPEN_FAILED'
}
Node.js v18.14.1
Here is the prebuild-install
output, but it looks strange to me compared to tho other issues. Why does it say v1.0.0
all over? Also, the target says 14.17.5
. Should it be my Node.js version?
PS C:\Users\me\app\server> yarn run prebuild-install --verbose
prebuild-install info begin Prebuild-install version 7.1.1
prebuild-install info looking for local prebuild @ prebuilds\server-v1.0.0-node-v83-win32-x64.tar.gz
prebuild-install info looking for cached prebuild @ C:\Users\jkrull\AppData\Roaming\npm-cache\_prebuilds\073042-server-v1.0.0-node-v83-win32-x64.tar.gz
prebuild-install http request GET undefined/releases/download/v1.0.0/server-v1.0.0-node-v83-win32-x64.tar.gz
prebuild-install http 400 undefined/releases/download/v1.0.0/server-v1.0.0-node-v83-win32-x64.tar.gz
prebuild-install warn install No prebuilt binaries found (target=14.17.5 runtime=node arch=x64 libc= platform=win32)
I have no idea where to go from here. I even tried installing a few older versions of msnodesqlv8 with no luck. Thanks!