Postingan lainnya
Ada yang bisa install oracledb di npm?
Installasi oracledb saya selalu error, gara-garanya package "node-gyp rebuild" gak bekerja, nggak tau kenapa. Saya sudah nginstall oracle client, gcc/g++, build-essential, dan ngikutin banyak tutorial-tutorial, tapi gak berhasil.
Apa temen-temen ada yang pernah nginstall oracledb? node-gyp rebuildnya bisa nggak? Atau ada yang tau solusinya?
EDITED: Saya pakek Linux Xubuntu 12.04, NodeJS 6.9.5, NPM 3.10.10.
Errornya
> oracledb@1.12.2 install /media/8e2eb7ea-483c-40e9-893b-b31b0e308599/wawa/htdocs/ibank/node_modules/oracledb
> node-gyp rebuild
node-oracledb ERR! Error: Cannot find $OCI_LIB_DIR/libclntsh.so
node-oracledb ERR! Error: See https://github.com/oracle/node-oracledb/blob/master/INSTALL.md
gyp: Call to 'INSTURL="https://github.com/oracle/node-oracledb/blob/master/INSTALL.md"; ERR="node-oracledb ERR! Error:"; if [ -z $OCI_LIB_DIR ]; then OCI_LIB_DIR=`ls -d /usr/lib/oracle/*/client*/lib/libclntsh.* 2> /dev/null | tail -1 | sed -e 's#/libclntsh[^/]*##'`; if [ -z $OCI_LIB_DIR ]; then if [ -z "$ORACLE_HOME" ]; then if [ -f /opt/oracle/instantclient/libclntsh.so ]; then echo "/opt/oracle/instantclient/"; else echo "$ERR Cannot find Oracle library libclntsh.so" >&2; echo "$ERR See $INSTURL" >&2; echo "" >&2; fi; else if [ -f "$ORACLE_HOME/lib/libclntsh.so" ]; then echo $ORACLE_HOME/lib; else echo "$ERR Cannot find \$ORACLE_HOME/lib/libclntsh.so" >&2; echo "$ERR See $INSTURL" >&2; echo "" >&2; fi; fi; else if [ -f "$OCI_LIB_DIR/libclntsh.so" ]; then echo $OCI_LIB_DIR; else echo "$ERR Cannot find \$OCI_LIB_DIR/libclntsh.so" >&2; echo "$ERR See $INSTURL" >&2; echo "" >&2; fi; fi; else if [ -f "$OCI_LIB_DIR/libclntsh.so" ]; then echo $OCI_LIB_DIR; else echo "$ERR Cannot find \$OCI_LIB_DIR/libclntsh.so" >&2; echo "$ERR See $INSTURL" >&2; echo "" >&2; fi; fi;' returned exit status 0 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 3.2.0-121-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /media/8e2eb7ea-483c-40e9-893b-b31b0e308599/wawa/htdocs/ibank/node_modules/oracledb
gyp ERR! node -v v6.9.5
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm WARN ibank@1.0.0 No description
npm WARN ibank@1.0.0 No repository field.
npm ERR! Linux 3.2.0-121-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "oracledb" "--save"
npm ERR! node v6.9.5
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! oracledb@1.12.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the oracledb@1.12.2 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the oracledb package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs oracledb
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls oracledb
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /media/8e2eb7ea-483c-40e9-893b-b31b0e308599/wawa/htdocs/ibank/npm-debug.log
6 Jawaban:
OS nya pake apa gan? karena disana banyak pilihan, biar member yang nyoba bisa sesuai OSnya
Udah cek halaman ini? di halaman ini ada keterangan untuk masing-masing OS [link]https://github.com/oracle/node-oracledb/blob/master/INSTALL.md[/link] dan bagian Prerequisites disini https://www.npmjs.com/package/oracledb
Keterangan errornya sih OCI_LIB_DIR path nya ngga kedetect
Sudah saya cek, requirementnya sudah saya penuhi. Nah, masih belum nemu cara mbenerin OCI nya itu bang.
hmm sayangnya saya ngga bisa ngetest masalahnya, di os yang beda, kalau dari errornya sih emang lokasi itunya yang salah, coba set export (cek solusi di issue ini) https://github.com/oracle/node-oracledb/issues/318
Jawaban Terpilih
SOLVED, bang Hilman. Ternyata saya kelewatan setting PATH-nya.
export OCI_LIB_DIR=/path/to/oracle/client/lib
export OCI_INC_DIR=/path/to/oracle/client/sdk/include