ibmdb / node-ibm_db

IBM DB2 and IBM Informix bindings for node
MIT License
190 stars 151 forks source link

Error on npm install and npm install ibm_db #789

Closed Violet-XiaoWeiHuang closed 3 years ago

Violet-XiaoWeiHuang commented 3 years ago

Hello,

I met the ISSUEs about _Failed at the ibmdb@2.7.4 install script to bothnpm install and npm install ibm_db.

Here is my current working environment

System Software Overview:
     System Version: macOS 11.5.1 (20G80)
     Kernel Version: Darwin 20.6.0
     Boot Volume: Macintosh HD

Xcode also installed image

npm install log showed as follow

% npm install
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
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 chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated

> fsevents@1.2.13 install /Users/violethuang/Documents/test/svt-dashboard/node_modules/fsevents
> node install.js

No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.

gyp: No Xcode or CLT version detected!
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Darwin 20.6.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/violethuang/Documents/test/svt-dashboard/node_modules/fsevents
gyp ERR! node -v v14.17.4
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok

> ibm_db@2.7.4 install /Users/violethuang/Documents/test/svt-dashboard/node_modules/ibm_db
> node installer/driverInstall.js

platform =  darwin , arch =  x64 , node.js version =  v14.17.4
make version = GNU Make 3.81
Downloading DB2 ODBC CLI Driver from https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/macos64_odbc_cli.tar.gz...

100.00% | 30120620 bytes downloaded out of 30120620 bytes.

****************************************
You are downloading a package which includes the Node.js module for IBM DB2/Informix.  The module is licensed under the Apache License 2.0. The package also includes IBM ODBC and CLI Driver from IBM, which is automatically downloaded as the node module is installed on your system/device. The license agreement to the IBM ODBC and CLI Driver is available in undefined   Check for additional dependencies, which may come with their own license agreement(s). Your use of the components of the package and dependencies constitutes your acceptance of their respective license agreements. If you do not accept the terms of any license agreement(s), then delete the relevant component(s) from your device.
****************************************

Downloading and extraction of DB2 ODBC CLI Driver completed successfully ...

Error: Command failed: node-gyp configure build  --IS_DOWNLOADED=true --IBM_DB_HOME="$IBM_DB_HOME"
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.

gyp: No Xcode or CLT version detected!
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Darwin 20.6.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build" "--IS_DOWNLOADED=true" "--IBM_DB_HOME=/Users/violethuang/Documents/test/svt-dashboard/node_modules/ibm_db/installer/clidriver"
gyp ERR! cwd /Users/violethuang/Documents/test/svt-dashboard/node_modules/ibm_db
gyp ERR! node -v v14.17.4
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok

    at ChildProcess.exithandler (child_process.js:390:12)
    at ChildProcess.emit (events.js:400:28)
    at maybeClose (internal/child_process.js:1055:16)
    at Socket.<anonymous> (internal/child_process.js:441:11)
    at Socket.emit (events.js:400:28)
    at Pipe.<anonymous> (net.js:675:12) {
  killed: false,
  code: 1,
  signal: null,
  cmd: 'node-gyp configure build  --IS_DOWNLOADED=true --IBM_DB_HOME="$IBM_DB_HOME"'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ibm_db@2.7.4 install: `node installer/driverInstall.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ibm_db@2.7.4 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/violethuang/.npm/_logs/2021-08-12T21_27_15_499Z-debug.log

I refered [https://github.com/ibmdb/node-ibm_db/issues/775]() to set up path IBM_DB_HOME export IBM_DB_HOME=/Users/violethuang/Documents/clidriver

% echo $IBM_DB_HOME
/Users/violethuang/Documents/clidriver

I tried npm install ibm_db itself

% npm install ibm_db

> ibm_db@2.7.4 install /Users/violethuang/Documents/test/svt-dashboard/node_modules/ibm_db
> node installer/driverInstall.js

platform =  darwin , arch =  x64 , node.js version =  v14.17.4
make version = GNU Make 3.81
IBM_DB_HOME environment variable have already been set to -> /Users/violethuang/Documents/clidriver

Downloading of clidriver skipped - build is in progress...

Error: Command failed: node-gyp configure build  --IS_DOWNLOADED=false --IBM_DB_HOME="$IBM_DB_HOME"
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.

gyp: No Xcode or CLT version detected!
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Darwin 20.6.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build" "--IS_DOWNLOADED=false" "--IBM_DB_HOME=/Users/violethuang/Documents/clidriver"
gyp ERR! cwd /Users/violethuang/Documents/test/svt-dashboard/node_modules/ibm_db
gyp ERR! node -v v14.17.4
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok

    at ChildProcess.exithandler (child_process.js:390:12)
    at ChildProcess.emit (events.js:400:28)
    at maybeClose (internal/child_process.js:1055:16)
    at Socket.<anonymous> (internal/child_process.js:441:11)
    at Socket.emit (events.js:400:28)
    at Pipe.<anonymous> (net.js:675:12) {
  killed: false,
  code: 1,
  signal: null,
  cmd: 'node-gyp configure build  --IS_DOWNLOADED=false --IBM_DB_HOME="$IBM_DB_HOME"'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ibm_db@2.7.4 install: `node installer/driverInstall.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ibm_db@2.7.4 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/violethuang/.npm/_logs/2021-08-12T21_37_39_950Z-debug.log

Please provide some guides to install ibm_db model. Thank you.

Violet

bimalkjha commented 3 years ago

@Violet-XiaoWeiHuang The problem is the installation of XCode is not correct and node scripts are unable to detect it. Otherwise you should not get below errro:

Error: Command failed: node-gyp configure build  --IS_DOWNLOADED=true --IBM_DB_HOME="$IBM_DB_HOME"
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.

gyp: No Xcode or CLT version detected!

Execute /usr/bin/xcodebuild -version from terminal to make sure xcode is installed. If it works, then restart the system and try npm install ibm_db. If still not working, then refer this page to troubleshoot the xcode installation issue. Thanks.

Violet-XiaoWeiHuang commented 3 years ago

Thank you Bimal. I need to manually select Command Line Tool from Xcode>Preferences>Locations>Command Line Tool. And the link your provided helped a lot.