Closed VinnyV88 closed 4 months ago
@VinnyV88 The output of npm i
command under node_modules/ibm_db
directory displays the Make
error. make version is empty. Make
is required to compile native code and generate bindings file.
Please install make
in your system and make sure commands make --version
and gcc --version
both are working without any error. Then rerun the npm i
command under ibm_db
directory again. It should fix the issue.
We have clearly documented the requirement of make
and gcc for non-windows systems in the documentation of ibm_db as prerequisite here: https://github.com/ibmdb/node-ibm_db?tab=readme-ov-file#prerequisite
Thanks.
Thank you, @bimalkjha for the reply. I did go through the prerequisites and installed the required software.
I did end up resolving the issue, but I wanted to share the process I went through in case someone else runs into the same issue I was having.
To confirm, I tried to install Make again:
vinnyv88@ViViD-Laptop:~$ sudo apt install make
[sudo] password for vinnyv88:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
make is already the newest version (4.3-4.1build1).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
But, the Make error was suspicious so I looked more into it. The make --version
command said I needed to run make init
. So I did and then make --version
returned 0.8.1
.
vinnyv88@ViViD-Laptop:~$ make --version
make ✖ ERR Missing Makefile / Bakefile
make ℹ info Run "make init" to generate a Makefile.
vinnyv88@ViViD-Laptop:~$ make init
make ℹ info Running default template in /home/vinnyv88
make ℹ info .npmignore -> ./.npmignore
make ℹ info .eslintignore -> ./.eslintignore
make ℹ info Makefile -> ./Makefile
make ℹ info package.json -> ./package.json
make ℹ info Build success in 14ms
vinnyv88@ViViD-Laptop:~$ make --version
0.8.1
That didn't match the 4.3-4.1build1
returned when I ran the make install
earlier. So, after more research, I found this article: https://askubuntu.com/questions/1146289/unable-to-run-makefile-targets-in-windows-subsystem-for-linux-ubuntu-18-04.
Apparently I had an NPM Make package installed which was blocking GNU Make from running. so I ran npm uninstall make -g
to remove the NPM package and everything worked from there.
Thanks again, have a great day!
Hello, I'm in the process of updating a website written a few years ago. I'm upgrading to the latest versions of O/S, db, Node and all library dependencies. I'm working on a Windows 11 PC, using WSL2, Linux Ubuntu O/S.
I've seen this issue has come up in the past and try the various fixes, but I have not had any luck getting this to work.
Please provide below information while opening an issue to understand your problem
db2level
command from Db2 database system: IBM i DB2 V7 R5For non-Windows system, output of below commands from terminal:
uname:
Linux
uname -m:x86_64
node -v:v20.11.1
npm ls ibm_db:db2level:
db2level: command not found
echo $IBM_DB_HOME:` echo $PATH:
/home/vinnyv88/.nvm/versions/node/v20.11.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Program Files/Microsoft/jdk-11.0.16.101-hotspot/bin:/mnt/c/Python38/Scripts/:/mnt/c/Python38/:/mnt/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/nodejs/:/mnt/c/ProgramData/chocolatey/bin:/mnt/c/Program Files/PuTTY/:/mnt/c/Users/Vinny/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/Vinny/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Users/Vinny/AppData/Roaming/npm:/mnt/c/adb:/mnt/c/Program Files/Microsoft SQL Server/150/Tools/Binn/:/mnt/c/Program Files/Microsoft SQL Server/Client SDK/ODBC/170/Tools/Binn/:/mnt/c/Program Files (x86)/Microsoft SQL Server/150/DTS/Binn/:/mnt/c/Program Files/Azure Data Studio/bin:/mnt/c/Program Files/dotnet/:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files (x86)/IBM/Client Access/Shared:/mnt/c/Program Files (x86)/IBM/Client Access/:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files/PowerShell/7/:/mnt/c/Users/Vinny/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/Vinny/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Users/Vinny/AppData/Roaming/npm:/mnt/c/Users/Vinny/.dotnet/tools:/mnt/c/Program Files/Azure Data Studio/bin:/mnt/c/Users/Vinny/AppData/Local/gitkraken/bin:/mnt/c/Users/Vinny/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/Vinny/.dotnet/tools:/snap/binecho $LD_LIBRARY_PATH
$DYLD_LIBRARY_PATH:`For Windows system, output of below commands from windows command prompt:
node -v npm ls ibm_db db2level echo %IBM_DB_HOME% echo %PATH% echo %LIB%
Please provide below problem specific info:
=========================================
For Installation related issue
npm install ibm_db
command.up to date, audited 534 packages in 3s
37 packages are looking for funding run
npm fund
for details13 vulnerabilities (4 moderate, 6 high, 3 critical)
To address issues that do not require attention, run: npm audit fix
To address all issues possible (including breaking changes), run: npm audit fix --force
Some issues need review, and may require choosing a different dependency.
Run
npm audit
for details.vinnyv88@ViViD-Laptop:~/dev/srspf-website/node_modules/ibm_db$ npm i
platform = linux, arch = x64, node.js version = v20.11.1 make ✖ ERR Missing Makefile / Bakefile make ℹ info Run "make init" to generate a Makefile. make version = Rebuild Process: Found clidriver at -> /home/vinnyv88/dev/srspf-website/node_modules/ibm_db/installer/clidriver
Downloading of clidriver skipped - build is in progress...
ibm_db installed successfully.
added 50 packages, and audited 51 packages in 4s
3 packages are looking for funding run
npm fund
for detailsfound 0 vulnerabilities vinnyv88@ViViD-Laptop:~/dev/srspf-website/node_modules/ibm_db$
vinnyv88@ViViD-Laptop:~/dev/srspf-website/node_modules/ibm_db$ node test/test-basic-test.js /home/vinnyv88/dev/srspf-website/node_modules/ibm_db/node_modules/bindings/bindings.js:135 throw err; ^
Error: Could not locate the bindings file. Tried: → /home/vinnyv88/dev/srspf-website/node_modules/ibm_db/build/odbc_bindings.node → /home/vinnyv88/dev/srspf-website/node_modules/ibm_db/build/Debug/odbc_bindings.node → /home/vinnyv88/dev/srspf-website/node_modules/ibm_db/build/Release/odbc_bindings.node → /home/vinnyv88/dev/srspf-website/node_modules/ibm_db/out/Debug/odbc_bindings.node → /home/vinnyv88/dev/srspf-website/node_modules/ibm_db/Debug/odbc_bindings.node → /home/vinnyv88/dev/srspf-website/node_modules/ibm_db/out/Release/odbc_bindings.node → /home/vinnyv88/dev/srspf-website/node_modules/ibm_db/Release/odbc_bindings.node → /home/vinnyv88/dev/srspf-website/node_modules/ibm_db/build/default/odbc_bindings.node → /home/vinnyv88/dev/srspf-website/node_modules/ibm_db/compiled/20.11.1/linux/x64/odbc_bindings.node → /home/vinnyv88/dev/srspf-website/node_modules/ibm_db/addon-build/release/install-root/odbc_bindings.node → /home/vinnyv88/dev/srspf-website/node_modules/ibm_db/addon-build/debug/install-root/odbc_bindings.node → /home/vinnyv88/dev/srspf-website/node_modules/ibm_db/addon-build/default/install-root/odbc_bindings.node → /home/vinnyv88/dev/srspf-website/node_modules/ibm_db/lib/binding/node-v115-linux-x64/odbc_bindings.node at bindings (/home/vinnyv88/dev/srspf-website/node_modules/ibm_db/node_modules/bindings/bindings.js:126:9) at Object. (/home/vinnyv88/dev/srspf-website/node_modules/ibm_db/lib/odbc.js:57:31)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at Object. (/home/vinnyv88/dev/srspf-website/node_modules/ibm_db/test/common.js:1:12)
at Module._compile (node:internal/modules/cjs/loader:1376:14) {
tries: [
'/home/vinnyv88/dev/srspf-website/node_modules/ibm_db/build/odbc_bindings.node',
'/home/vinnyv88/dev/srspf-website/node_modules/ibm_db/build/Debug/odbc_bindings.node',
'/home/vinnyv88/dev/srspf-website/node_modules/ibm_db/build/Release/odbc_bindings.node',
'/home/vinnyv88/dev/srspf-website/node_modules/ibm_db/out/Debug/odbc_bindings.node',
'/home/vinnyv88/dev/srspf-website/node_modules/ibm_db/Debug/odbc_bindings.node',
'/home/vinnyv88/dev/srspf-website/node_modules/ibm_db/out/Release/odbc_bindings.node',
'/home/vinnyv88/dev/srspf-website/node_modules/ibm_db/Release/odbc_bindings.node',
'/home/vinnyv88/dev/srspf-website/node_modules/ibm_db/build/default/odbc_bindings.node',
'/home/vinnyv88/dev/srspf-website/node_modules/ibm_db/compiled/20.11.1/linux/x64/odbc_bindings.node',
'/home/vinnyv88/dev/srspf-website/node_modules/ibm_db/addon-build/release/install-root/odbc_bindings.node',
'/home/vinnyv88/dev/srspf-website/node_modules/ibm_db/addon-build/debug/install-root/odbc_bindings.node',
'/home/vinnyv88/dev/srspf-website/node_modules/ibm_db/addon-build/default/install-root/odbc_bindings.node',
'/home/vinnyv88/dev/srspf-website/node_modules/ibm_db/lib/binding/node-v115-linux-x64/odbc_bindings.node'
]
}
Node.js v20.11.1