IBM Informix driver for NodeJS - Setting environme

2019-08-03 03:01发布

问题:

This is a follow on to my original question

I am trying to set up IBM's Informix driver for use with NodeJS on MacOS.

After viewing the Readme file for the Informix NPM library, I am a little confused as to what the environment variables are and whether I need to apply them all?

I managed to track down the install location for the SDK files: Applications/IBM/informix and then added this to the ~/.bash_profile file as so:

export INFORMIXDIR=/Applications/IBM/informix
export PATH=$PATH:$INFORMIDIR

Should I change my PATH to include /bin at the end?

I am also confused by the remainder of the statements in the Readme. I was expecting to set the server name and host dynamically rather than hard-coding them?

Some guidance would be appreciated.

回答1:

The PATH env variable needs $INFORMIXDIR/bin. (There is nothing in plain $INFORMIXDIR worth running other than the install script).

INFORMIXSERVER and INFORMIXSQLHOSTS may be needed for testing the module, but they are not hardcoded (the module will not store that anywhere) You will always be able to specify a different INFORMIXSERVER/INFORMIXSQLHOSTS at runtime.

I never tried it on a MacOS, but you may also need to add DYLD_LIBRARY_PATH, something like "export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH" to your script. Some MacOS binaries will use DYLD_LIBRARY_PATH instead of LD_LIBRARY_PATH.