node-odbc icon indicating copy to clipboard operation
node-odbc copied to clipboard

[HELP] Node pre gyp fails when running npm install

Open petterjohansson opened this issue 1 year ago • 3 comments

Any tips to get around this issue, when i bump package.json and the odbc to 2.4.8 I get an issue with the installation.

npm ERR! code 1 npm ERR! path /home/petter/test2/nice-rest/node_modules/odbc npm ERR! command failed npm ERR! command sh -c node-pre-gyp install --fallback-to-build npm ERR! gmake: Entering directory '/home/petter/test2/nice-rest/node_modules/odbc/build' npm ERR! CXX(target) Release/obj.target/odbc/src/odbc.o npm ERR! gmake: Leaving directory '/home/petter/test2/nice-rest/node_modules/odbc/build' npm ERR! Failed to execute '/QOpenSys/pkgs/lib/nodejs18/bin/node /QOpenSys/pkgs/lib/nodejs18/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/petter/test2/nice-rest/node_modules/odbc/lib/bindings/napi-v6/odbc.node --module_name=odbc --module_path=/home/petter/test2/nice-rest/node_modules/odbc/lib/bindings/napi-v6 --napi_version=8 --node_abi_napi=napi --napi_build_version=6 --node_napi_label=napi-v6' (1) npm ERR! node-pre-gyp info it worked if it ends with ok npm ERR! node-pre-gyp info using @1.0.11 npm ERR! node-pre-gyp info using [email protected] | os400 | ppc64 npm ERR! node-pre-gyp info check checked for "/home/petter/test2/nice-rest/node_modules/odbc/lib/bindings/napi-v6/odbc.node" (not found) npm ERR! node-pre-gyp http GET https://github.com/markdirish/node-odbc/releases/download/v2.4.8/odbc-v2.4.8-os400-ppc64-napi-v6.tar.gz npm ERR! node-pre-gyp ERR! install request to https://objects.githubusercontent.com/github-production-release-asset-2e65be/146304236/fa066300-abb4-4732-91ab-e47104c46794?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20240115%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240115T164355Z&X-Amz-Expires=300&X-Amz-Signature=e2623448563cbec418a2b92a949042be4012e7119fb13178949cf29ee15f3c61&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=146304236&response-content-disposition=attachment%3B%20filename%3Dodbc-v2.4.8-os400-ppc64-napi-v6.tar.gz&response-content-type=application%2Foctet-stream failed, reason: read ECONNRESET npm ERR! node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v108 ABI, unknown) (falling back to source compile with node-gyp) npm ERR! node-pre-gyp WARN Hit error request to https://objects.githubusercontent.com/github-production-release-asset-2e65be/146304236/fa066300-abb4-4732-91ab-e47104c46794?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20240115%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240115T164355Z&X-Amz-Expires=300&X-Amz-Signature=e2623448563cbec418a2b92a949042be4012e7119fb13178949cf29ee15f3c61&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=146304236&response-content-disposition=attachment%3B%20filename%3Dodbc-v2.4.8-os400-ppc64-napi-v6.tar.gz&response-content-type=application%2Foctet-stream failed, reason: read ECONNRESET npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using [email protected] npm ERR! gyp info using [email protected] | os400 | ppc64 npm ERR! gyp info ok npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using [email protected] npm ERR! gyp info using [email protected] | os400 | ppc64 npm ERR! gyp info find Python using Python version 3.9.6 found at "/QOpenSys/pkgs/bin/python3" npm ERR! gyp info spawn /QOpenSys/pkgs/bin/python3 npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args '/QOpenSys/pkgs/lib/nodejs18/lib/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 'make', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/home/petter/test2/nice-rest/node_modules/odbc/build/config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/QOpenSys/pkgs/lib/nodejs18/lib/node_modules/npm/node_modules/node-gyp/addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/home/petter/.cache/node-gyp/18.0.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=/home/petter/.cache/node-gyp/18.0.0', npm ERR! gyp info spawn args '-Dnode_exp_file=/QOpenSys/pkgs/lib/nodejs18/include/node/node.exp', npm ERR! gyp info spawn args '-Dnode_gyp_dir=/QOpenSys/pkgs/lib/nodejs18/lib/node_modules/npm/node_modules/node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=/home/petter/.cache/node-gyp/18.0.0/<(target_arch)/node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=/home/petter/test2/nice-rest/node_modules/odbc', 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 'build', npm ERR! gyp info spawn args '-Goutput_dir=.' npm ERR! gyp info spawn args ] npm ERR! gyp info ok npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using [email protected] npm ERR! gyp info using [email protected] | os400 | ppc64 npm ERR! gyp info spawn gmake npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] npm ERR! In file included from /usr/include/sys/resource.h:57:0, npm ERR! from /QOpenSys/pkgs/lib/gcc/powerpc-ibm-aix6.1.0.0/6.3.0/include-fixed-7.1/sys/wait.h:56, npm ERR! from /QOpenSys/pkgs/lib/gcc/powerpc-ibm-aix6.1.0.0/6.3.0/include-fixed-7.1/stdlib.h:386, npm ERR! from /QOpenSys/pkgs/lib/gcc/powerpc-ibm-aix6.1.0.0/6.3.0/include/c++/cstdlib:75, npm ERR! from /QOpenSys/pkgs/lib/gcc/powerpc-ibm-aix6.1.0.0/6.3.0/include/c++/stdlib.h:36, npm ERR! from ../src/odbc.cpp:20: npm ERR! /usr/include/sys/time.h:108:16: error: redefinition of 'struct sigset_t' npm ERR! typedef struct sigset_t { npm ERR! ^~~~~~~~ npm ERR! In file included from /QOpenSys/pkgs/lib/gcc/powerpc-ibm-aix6.1.0.0/6.3.0/include-fixed-7.1/time.h:199:0, npm ERR! from ../src/odbc.cpp:19: npm ERR! /QOpenSys/pkgs/lib/gcc/powerpc-ibm-aix6.1.0.0/6.3.0/include-fixed-7.1/sys/types.h:345:16: error: previous definition of 'struct sigset_t' npm ERR! typedef struct sigset_t { npm ERR! ^~~~~~~~ npm ERR! In file included from /usr/include/sys/resource.h:57:0, npm ERR! from /QOpenSys/pkgs/lib/gcc/powerpc-ibm-aix6.1.0.0/6.3.0/include-fixed-7.1/sys/wait.h:56, npm ERR! from /QOpenSys/pkgs/lib/gcc/powerpc-ibm-aix6.1.0.0/6.3.0/include-fixed-7.1/stdlib.h:386, npm ERR! from /QOpenSys/pkgs/lib/gcc/powerpc-ibm-aix6.1.0.0/6.3.0/include/c++/cstdlib:75, npm ERR! from /QOpenSys/pkgs/lib/gcc/powerpc-ibm-aix6.1.0.0/6.3.0/include/c++/stdlib.h:36, npm ERR! from ../src/odbc.cpp:20: npm ERR! /usr/include/sys/time.h:124:3: error: conflicting declaration 'typedef int sigset_t' npm ERR! } sigset_t; npm ERR! ^~~~~~~~ npm ERR! In file included from /QOpenSys/pkgs/lib/gcc/powerpc-ibm-aix6.1.0.0/6.3.0/include-fixed-7.1/time.h:199:0, npm ERR! from ../src/odbc.cpp:19: npm ERR! /QOpenSys/pkgs/lib/gcc/powerpc-ibm-aix6.1.0.0/6.3.0/include-fixed-7.1/sys/types.h:361:3: note: previous declaration as 'typedef struct sigset_t sigset_t' npm ERR! } sigset_t; npm ERR! ^~~~~~~~ npm ERR! gmake: *** [odbc.target.mk:136: Release/obj.target/odbc/src/odbc.o] Error 1 npm ERR! gyp ERR! build error npm ERR! gyp ERR! stack Error: gmake failed with exit code: 2 npm ERR! gyp ERR! stack at ChildProcess.onExit (/QOpenSys/pkgs/lib/nodejs18/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:527:28) npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12) npm ERR! gyp ERR! System OS400 7.5 npm ERR! gyp ERR! command "/QOpenSys/pkgs/lib/nodejs18/bin/node" "/QOpenSys/pkgs/lib/nodejs18/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/petter/test2/nice-rest/node_modules/odbc/lib/bindings/napi-v6/odbc.node" "--module_name=odbc" "--module_path=/home/petter/test2/nice-rest/node_modules/odbc/lib/bindings/napi-v6" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=6" "--node_napi_label=napi-v6" npm ERR! gyp ERR! cwd /home/petter/test2/nice-rest/node_modules/odbc npm ERR! gyp ERR! node -v v18.0.0 npm ERR! gyp ERR! node-gyp -v v9.3.0 npm ERR! gyp ERR! not ok npm ERR! node-pre-gyp ERR! build error npm ERR! node-pre-gyp ERR! stack Error: Failed to execute '/QOpenSys/pkgs/lib/nodejs18/bin/node /QOpenSys/pkgs/lib/nodejs18/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/petter/test2/nice-rest/node_modules/odbc/lib/bindings/napi-v6/odbc.node --module_name=odbc --module_path=/home/petter/test2/nice-rest/node_modules/odbc/lib/bindings/napi-v6 --napi_version=8 --node_abi_napi=napi --napi_build_version=6 --node_napi_label=napi-v6' (1) npm ERR! node-pre-gyp ERR! stack at ChildProcess. (/home/petter/test2/nice-rest/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23) npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (node:events:527:28) npm ERR! node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1090:16) npm ERR! node-pre-gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:302:5) npm ERR! node-pre-gyp ERR! System OS400 7.5 npm ERR! node-pre-gyp ERR! command "/QOpenSys/pkgs/lib/nodejs18/bin/node" "/home/petter/test2/nice-rest/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" npm ERR! node-pre-gyp ERR! cwd /home/petter/test2/nice-rest/node_modules/odbc npm ERR! node-pre-gyp ERR! node -v v18.0.0 npm ERR! node-pre-gyp ERR! -v v1.0.11 npm ERR! node-pre-gyp ERR! not ok

npm ERR! A complete log of this run can be found in: npm ERR! /home/petter/.npm/_logs/2024-01-15T16_43_26_499Z-debug-0.log

petterjohansson avatar Jan 15 '24 18:01 petterjohansson

Looks like you're on IBM i 7.5. The header files shipped with GCC 6 is not compatible with 7.5, so you need to use GCC 10.

You'll need to install gcc10-cplusplus and then tell npm to use it, eg. CXX=g++-10 npm install.

kadler avatar Jan 16 '24 15:01 kadler

Thanks, that solved the problem. 👍
Do you know how to instruct NPM to use this as a default?

/Petter

petterjohansson avatar Jan 17 '24 09:01 petterjohansson

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 17 '24 01:04 stale[bot]