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

Cannot find module '../build/Release/sqlserverv8.node' - Windows 10 / node.js v20.11.0/v21.6.1 #319

Open
drellert opened this issue Jan 29, 2024 · 1 comment

Comments

@drellert
Copy link

After updating to node v.20.11.0 (and npm v10.4.0), I cannot install msnodesqlv8. It was working fine before, but the update required me to rebuild my project and now installation is failing on this package (npm install msnodesqlv8 --save, with or without --save). Installing another package (npm install ws) works just fine.

I am running my project on a server with 64-bit Windows 10 (Windows Server 2019 Datacenter), x64 based processor.

This is the full stack trace after running npm install msnodesqlv8 --save:

npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated adal-node@0.2.4: This package is no longer supported. Please migrate to @azure/msal-node.
npm WARN deprecated @azure/msal-node@1.0.0-beta.6: A newer major version of this library is available. Please upgrade to the latest available version.
npm WARN deprecated msal@1.4.18: This package is no longer supported. Please use @azure/msal-browser instead.
npm WARN cleanup Failed to remove some directories [
npm WARN cleanup   [
npm WARN cleanup     'C:\\dkit-assets\\server\\node_modules',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\dkit-assets\server\node_modules\table\node_modules\ajv\lib\refs'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\dkit-assets\\server\\node_modules\\table\\node_modules\\ajv\\lib\\refs'
npm WARN cleanup     }
npm WARN cleanup   ]
npm WARN cleanup ]
npm ERR! code 1
npm ERR! path C:\dkit-assets\server\node_modules\msnodesqlv8
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c prebuild-install || node-gyp rebuild
npm ERR! Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
npm ERR!   print_variables
npm ERR!   '"echo"' is not recognized as an internal or external command,
npm ERR!   operable program or batch file.
npm ERR! C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(209,5): error MSB6006: "cmd.exe" exited with code 1. [C:\dkit-assets\server\node_modules\msnodesqlv8\build\sqlserverv8.vcxproj]
npm ERR! prebuild-install warn install read ECONNRESET
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@10.0.1
npm ERR! gyp info using node@20.11.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.12.1 found at "C:\Program Files\Python312\python.exe"
npm ERR! gyp info find VS using VS2017 (15.9.34031.82) found at:
npm ERR! gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp info spawn C:\Program Files\Python312\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'C:\\Users\\GLBL_RDP_USER_01\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'msvs',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\dkit-assets\\server\\node_modules\\msnodesqlv8\\build\\config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\GLBL_RDP_USER_01\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\GLBL_RDP_USER_01\\AppData\\Local\\node-gyp\\Cache\\20.11.0\\include\\node\\common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=C:\\Users\\GLBL_RDP_USER_01\\AppData\\Local\\node-gyp\\Cache\\20.11.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=C:\\Users\\GLBL_RDP_USER_01\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\GLBL_RDP_USER_01\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\20.11.0\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=C:\\dkit-assets\\server\\node_modules\\msnodesqlv8',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'C:\\dkit-assets\\server\\node_modules\\msnodesqlv8\\build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'build\\binding.sln',
npm ERR! gyp info spawn args '/clp:Verbosity=minimal',
npm ERR! gyp info spawn args '/nologo',
npm ERR! gyp info spawn args '/p:Configuration=Release;Platform=x64'
npm ERR! gyp info spawn args ]
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\GLBL_RDP_USER_01\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:209:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:518:28)
npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12)
npm ERR! gyp ERR! System Windows_NT 10.0.17763
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\GLBL_RDP_USER_01\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\dkit-assets\server\node_modules\msnodesqlv8
npm ERR! gyp ERR! node -v v20.11.0
npm ERR! gyp ERR! node-gyp -v v10.0.1
npm ERR! gyp ERR! not ok
@drellert drellert changed the title Installation error - npm ERR! gyp ERR! Installation error - Windows 10 / node.js v20.11.0 Jan 29, 2024
@drellert
Copy link
Author

drellert commented Feb 13, 2024

I got it to work by placing the tar.gz file in the folder mentioned in the verbose stack (as per npm ERR! prebuild-install info looking for cached prebuild @ C:\Users\GLBL_RDP_USER_01\AppData\Local\npm-cache\_prebuilds\913611-msnodesqlv8-v4.1.2-node-v115-win32-x64.tar.gz).

However, now, while my dev server is working just fine, my prod server shows the following when attempting to start my node.js server:

Error: Cannot find module '../build/Release/sqlserverv8.node'
Require stack:
- C:\DKAssets\Backend\node_modules\msnodesqlv8\lib\util.js
- C:\DKAssets\Backend\node_modules\msnodesqlv8\lib\table-column.js
- C:\DKAssets\Backend\node_modules\msnodesqlv8\lib\table.js
- C:\DKAssets\Backend\node_modules\msnodesqlv8\lib\connection.js
- C:\DKAssets\Backend\node_modules\msnodesqlv8\lib\sql-client.js
- C:\DKAssets\Backend\node_modules\msnodesqlv8\lib\sql.js
- C:\DKAssets\Backend\node_modules\mssql\lib\msnodesqlv8\connection-pool.js
- C:\DKAssets\Backend\node_modules\mssql\lib\msnodesqlv8\index.js
- C:\DKAssets\Backend\node_modules\mssql\msnodesqlv8.js
- C:\DKAssets\Backend\src\controllers\websocket\database\index.js
- C:\DKAssets\Backend\src\controllers\websocket\index.js
- C:\DKAssets\Backend\src\app.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1149:15)
    at Module._load (node:internal/modules/cjs/loader:990:27)
    at Module.require (node:internal/modules/cjs/loader:1237:19)
    at require (node:internal/modules/helpers:176:18)
    at C:\DKAssets\Backend\node_modules\msnodesqlv8\lib\util.js:4:21
    at Object.<anonymous> (C:\DKAssets\Backend\node_modules\msnodesqlv8\lib\util.js:34:3)
    at Module._compile (node:internal/modules/cjs/loader:1378:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1437:10)
    at Module.load (node:internal/modules/cjs/loader:1212:32)
    at Module._load (node:internal/modules/cjs/loader:1028:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\DKAssets\\Backend\\node_modules\\msnodesqlv8\\lib\\util.js',
    'C:\\DKAssets\\Backend\\node_modules\\msnodesqlv8\\lib\\table-column.js',
    'C:\\DKAssets\\Backend\\node_modules\\msnodesqlv8\\lib\\table.js',
    'C:\\DKAssets\\Backend\\node_modules\\msnodesqlv8\\lib\\connection.js',
    'C:\\DKAssets\\Backend\\node_modules\\msnodesqlv8\\lib\\sql-client.js',
    'C:\\DKAssets\\Backend\\node_modules\\msnodesqlv8\\lib\\sql.js',
    'C:\\DKAssets\\Backend\\node_modules\\mssql\\lib\\msnodesqlv8\\connection-pool.js',
    'C:\\DKAssets\\Backend\\node_modules\\mssql\\lib\\msnodesqlv8\\index.js',
    'C:\\DKAssets\\Backend\\node_modules\\mssql\\msnodesqlv8.js',
    'C:\\DKAssets\\Backend\\src\\controllers\\websocket\\database\\index.js',
    'C:\\DKAssets\\Backend\\src\\controllers\\websocket\\index.js',
    'C:\\DKAssets\\Backend\\src\\app.js'
  ]
}

The '../build/' folder is indeed empty on my prod server, but not on my dev server. I've installed the package in exactly the same manner on both servers. I cannot manually copy the contents of the '../build/' folder from dev to prod, since my dev server uses node v20.11.0 while prod uses node v21.6.1 (for no apparent reason, since I used the same msi-file from https://nodejs.org/ on both servers). Manually copying the contents results in a "Module did not self-register" error instead.

image

@drellert drellert changed the title Installation error - Windows 10 / node.js v20.11.0 Cannot find module '../build/Release/sqlserverv8.node' - Windows 10 / node.js v20.11.0/v21.6.1 Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant