-
Notifications
You must be signed in to change notification settings - Fork 44
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
Error: Module did not self-register #279
Comments
Are there any environment variables that have to be set in order for this package to be installed properly? |
can we start with the simplest example if you do following and change connection string in index.,js then what happens - all binaries for all versions of node for linux,mac and windows are ready built and on release page js\sql\app
❯ git clone https://github.com/TimelordUK/msnodesqlv8_yarn_sample.git
Cloning into 'msnodesqlv8_yarn_sample'...
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 5 (delta 0), reused 5 (delta 0), pack-reused 0
Receiving objects: 100% (5/5), 6.15 KiB | 3.07 MiB/s, done.
js\sql\app
❯ cd .\msnodesqlv8_yarn_sample\
msnodesqlv8_yarn_sample on master is 📦 v1.0.0 via v18.12.0
❯ yarn install
yarn install v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 0.92s.
msnodesqlv8_yarn_sample on master [?] is 📦 v1.0.0 via v18.12.0
❯ yarn run test
yarn run v1.22.19
$ node index
using connection 'Driver={ODBC Driver 17 for SQL Server};Server=(localdb)\node;Database=scratch;Trusted_Connection=yes;' run query 'SELECT top 2 * FROM syscolumns'
{
"elapsed": 2,
"first": [
{
"name": "rsid",
"id": 3,
"xtype": 127,
"typestat": 1,
"xusertype": 127,
"length": 8,
"xprec": 19,
"xscale": 0,
"colid": 1,
"xoffset": 0,
"bitpos": 0,
"reserved": 0,
"colstat": 0,
"cdefault": 0,
"domain": 0,
"number": 0,
"colorder": 1,
"autoval": null,
"offset": 0,
"collationid": 0,
"language": 0,
"status": 0,
"type": 63,
"usertype": 0,
"printfmt": null,
"prec": 19,
"scale": 0,
"iscomputed": 0,
"isoutparam": 0,
"isnullable": 0,
"collation": null,
"tdscollation": {
"type": "Buffer",
"data": [
0,
0,
0,
0,
0
]
}
}, this step should automatically happen - the prebuild should as part of install go to release page download the right version and place it in the node_modules/msnodesqlv8/build folder we can run into issues where for example the project is installed locally running one version of node and it is packaged and installed on a server with different node or even OS - the error you see is Node saying this binary for this project cannot load into this instance of node. you may now have a corrupted local prebuild cache - so yoiu mag want to delete all related folders as below under Roaming as the prebuild intall will use a local copy if it is there. ❯ .\node_modules\msnodesqlv8\node_modules\.bin\prebuild-install --verbose
prebuild-install info begin Prebuild-install version 7.1.1
prebuild-install info looking for local prebuild @ prebuilds\msnodesqlv8_yarn_sample-v1.0.0-node-v108-win32-x64.tar.gz
prebuild-install info looking for cached prebuild @ C:\Users\me\AppData\Roaming\npm-cache\_prebuilds\238a91-msnodesqlv8-yarn-sample-v1.0.0-node-v108-win32-x64.tar.gz
prebuild-install http request GET undefined/releases/download/v1.0.0/msnodesqlv8_yarn_sample-v1.0.0-node-v108-win32-x64.tar.gz
prebuild-install warn install connect ECONNREFUSED ::1:80 |
the version issue you mention - the above command is just to show you where command is holding cache what is actually going on during install you can do following# msnodesqlv8_yarn_sample on master [?] is 📦 v1.0.0 via v18.12.0
❯ cd .\node_modules\msnodesqlv8\
msnodesqlv8_yarn_sample\node_modules\msnodesqlv8 on master [?] is 📦 v3.0.1 via v18.12.0
❯ yarn run prebuild-install --verbose
yarn run v1.22.19
$ C:\Users\me\dev\js\sql\app\msnodesqlv8_yarn_sample\node_modules\msnodesqlv8\node_modules\.bin\prebuild-install --verbose
prebuild-install info begin Prebuild-install version 7.1.1
prebuild-install info looking for local prebuild @ prebuilds\msnodesqlv8-v3.0.1-node-v108-win32-x64.tar.gz
prebuild-install info looking for cached prebuild @ C:\Users\me\AppData\Roaming\npm-cache\_prebuilds\9e6d0e-msnodesqlv8-v3.0.1-node-v108-win32-x64.tar.gz
prebuild-install info found cached prebuild
prebuild-install info unpacking @ C:\Users\me\AppData\Roaming\npm-cache\_prebuilds\9e6d0e-msnodesqlv8-v3.0.1-node-v108-win32-x64.tar.gz
prebuild-install info unpack resolved to C:\Users\me\dev\js\sql\app\msnodesqlv8_yarn_sample\node_modules\msnodesqlv8\build\Release\sqlserverv8.node
prebuild-install info unpack required C:\Users\me\dev\js\sql\app\msnodesqlv8_yarn_sample\node_modules\msnodesqlv8\build\Release\sqlserverv8.node successfully
prebuild-install info install Successfully installed prebuilt binary!
Done in 0.28s.
msnodesqlv8_yarn_sample\node_modules\msnodesqlv8 on master [?] is 📦 v3.0.1 via v18.12.0 |
I cloned the repo and followed the steps you did above.
Then did the prebuild-install step after deleting the contents of the _prebuilds folder:
So now I'm trying to understand how |
you have to cd into the node_modules/msnodesqlv8 folder and run as above it is looking specifically for version based on the package.json file - see above there is not much in way of dependencies - both kernel32.dll and odbc32.dll which should be on your system fine. the fact it does not even load is strange - ODBC itself will load the MS driver and it could report a failure to load but then we would get an application error this is saying the module will not even load. have you tried a different node version out of interest - i have just tried 18.14.1 and it seems to be ok on my platform - i will try some other computers later node --version Administrator in msnodesqlv8_yarn_sample on master [?] is 📦 v1.0.0 via v18.14.1 dumpbin /dependents sqlserverv8.node Dump of file sqlserverv8.node File Type: DLL Image has the following dependencies:
Image has the following delay load dependencies:
|
make sure you also have latest MS cpp runtime but that should be on your system if you update on regular basis the cpp driver is built with the VS2022 toolchain https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170 should be this one |
I install Node.js via fnm because I have to change versions regularly. I wonder if that could be part of the problem, but if so I have to understand why, because that's also used for pipelines and other things. I did try several versions of Node.js before coming here for help. Here is the last attempt, after correctly changing directories as you pointed out. I had to run
I'll be researching lzma-native now, and reasons why it might fail. |
Heave you ever find the reason for that? I have somehow similar things happening with electron based app. |
For reference, I had this problem on both Node 20.9 and Node 21.1 on my windows x64. |
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:
Added msnodesqlv8 (edited for brevity):
I then ran a version of the following script:
And the error occurred at this point:
Here is the
prebuild-install
output, but it looks strange to me compared to tho other issues. Why does it sayv1.0.0
all over? Also, the target says14.17.5
. Should it be my Node.js version?I have no idea where to go from here. I even tried installing a few older versions of msnodesqlv8 with no luck. Thanks!
The text was updated successfully, but these errors were encountered: