Chetan Sachdev
9 min readJan 10, 2019

Solved — Installing node-pdfbox in OSX

Last login: Wed Jan  9 11:41:57 on ttys000
/Users/Chetan/.zshrc:106: parse error near `then'

~
➜ java -version
openjdk version "11.0.1" 2018-10-16
OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)

~
➜ cd ~/Documents/code/pdf2ecml

pdf2ecml on  development is 📦 v1.0.0 via ⬢ v10.4.0


pdf2ecml on  development is 📦 v1.0.0 via ⬢ v10.4.0
➜ rm -R node_modules

pdf2ecml on  development is 📦 v1.0.0 via ⬢ v10.4.0
➜ npm i

$(spaceship_rprompt)
$(spaceship_rprompt)

pdf2ecml on  development is 📦 v1.0.0 via ⬢ v10.4.0
➜ nvm use v8.11.1
Now using node v8.11.1 (npm v5.6.0)

pdf2ecml on  development is 📦 v1.0.0 via ⬢ v8.11.1
➜ ll
total 104
-rw-r--r-- 1 Chetan staff 33B Jan 8 12:58 README.md
drwxr-xr-x 6 Chetan staff 192B Jan 8 12:58 config
drwxr-xr-x 5 Chetan staff 160B Jan 8 12:58 documentation
-rw-r--r-- 1 Chetan staff 6.5K Jan 8 12:58 image2ecml.js
drwxr-xr-x 4 Chetan staff 128B Jan 8 12:58 input
drwxr-xr-x 3 Chetan staff 96B Jan 9 11:47 node_modules
-rw-r--r-- 1 Chetan staff 30K Jan 8 12:58 package-lock.json
-rw-r--r-- 1 Chetan staff 460B Jan 8 12:58 package.json
-rw-r--r-- 1 Chetan staff 3.2K Jan 8 12:58 pdf2Image.js

pdf2ecml on  development is 📦 v1.0.0 via ⬢ v8.11.1
➜ rm -R node_modules

pdf2ecml on  development is 📦 v1.0.0 via ⬢ v8.11.1
➜ npm i

> java@0.8.0 install /Users/Chetan/Documents/code/pdf2ecml/node_modules/java
> node-gyp rebuild

gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
CXX(target) Release/obj.target/nodejavabridge_bindings/src/java.o
../src/java.cpp:897:40: warning: 'ToNumber' is deprecated [-Wdeprecated-declarations]
v8::Local<v8::Number> val = info[0]->ToNumber();
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8.h:2333:10: note: 'ToNumber' has been explicitly marked deprecated here
inline V8_DEPRECATED("Use maybe version", Local<Number> ToNumber() const);
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
../src/java.cpp:927:40: warning: 'ToNumber' is deprecated [-Wdeprecated-declarations]
v8::Local<v8::Number> val = info[0]->ToNumber();
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8.h:2333:10: note: 'ToNumber' has been explicitly marked deprecated here
inline V8_DEPRECATED("Use maybe version", Local<Number> ToNumber() const);
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
../src/java.cpp:956:40: warning: 'ToNumber' is deprecated [-Wdeprecated-declarations]
v8::Local<v8::Number> val = info[0]->ToNumber();
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8.h:2333:10: note: 'ToNumber' has been explicitly marked deprecated here
inline V8_DEPRECATED("Use maybe version", Local<Number> ToNumber() const);
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
../src/java.cpp:983:42: warning: 'ToNumber' is deprecated [-Wdeprecated-declarations]
v8::Local<v8::Number> val = info[0]->ToNumber();
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8.h:2333:10: note: 'ToNumber' has been explicitly marked deprecated here
inline V8_DEPRECATED("Use maybe version", Local<Number> ToNumber() const);
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
../src/java.cpp:1019:40: warning: 'ToNumber' is deprecated [-Wdeprecated-declarations]
v8::Local<v8::Number> val = info[0]->ToNumber();
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8.h:2333:10: note: 'ToNumber' has been explicitly marked deprecated here
inline V8_DEPRECATED("Use maybe version", Local<Number> ToNumber() const);
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
../src/java.cpp:1044:40: warning: 'ToNumber' is deprecated [-Wdeprecated-declarations]
v8::Local<v8::Number> val = info[0]->ToNumber();
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8.h:2333:10: note: 'ToNumber' has been explicitly marked deprecated here
inline V8_DEPRECATED("Use maybe version", Local<Number> ToNumber() const);
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
../src/java.cpp:1263:16: warning: 'TryCatch' is deprecated [-Wdeprecated-declarations]
v8::TryCatch tryCatch;
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8.h:8313:3: note: 'TryCatch' has been explicitly marked deprecated here
V8_DEPRECATED("Use isolate version", TryCatch());
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
7 warnings generated.
CXX(target) Release/obj.target/nodejavabridge_bindings/src/javaObject.o
../src/javaObject.cpp:116:47: warning: 'NewInstance' is deprecated [-Wdeprecated-declarations]
v8::Local<v8::Object> javaObjectObj = ctor->NewInstance();
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8.h:3851:3: note: 'NewInstance' has been explicitly marked deprecated here
V8_DEPRECATED("Use maybe version", Local<Object> NewInstance() const);
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
../src/javaObject.cpp:349:47: warning: 'NewInstance' is deprecated [-Wdeprecated-declarations]
v8::Local<v8::Object> javaObjectObj = ctor->NewInstance();
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8.h:3851:3: note: 'NewInstance' has been explicitly marked deprecated here
V8_DEPRECATED("Use maybe version", Local<Object> NewInstance() const);
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
2 warnings generated.
CXX(target) Release/obj.target/nodejavabridge_bindings/src/javaScope.o
CXX(target) Release/obj.target/nodejavabridge_bindings/src/methodCallBaton.o
CXX(target) Release/obj.target/nodejavabridge_bindings/src/nodeJavaBridge.o
CXX(target) Release/obj.target/nodejavabridge_bindings/src/utils.o
../src/utils.cpp:347:21: warning: 'ToInt32' is deprecated [-Wdeprecated-declarations]
jint val = arg->ToInt32()->Value();
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8.h:2341:10: note: 'ToInt32' has been explicitly marked deprecated here
inline V8_DEPRECATED("Use maybe version", Local<Int32> ToInt32() const);
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
../src/utils.cpp:354:24: warning: 'ToNumber' is deprecated [-Wdeprecated-declarations]
jdouble val = arg->ToNumber()->Value();
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8.h:2333:10: note: 'ToNumber' has been explicitly marked deprecated here
inline V8_DEPRECATED("Use maybe version", Local<Number> ToNumber() const);
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
2 warnings generated.
SOLINK_MODULE(target) Release/nodejavabridge_bindings.node
ld: warning: directory not found for option '-L/Library/Java/JavaVirtualMachines/openjdk-11.0.1.jdk/Contents/Home/jre/lib/server'
ld: library not found for -ljvm
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Release/nodejavabridge_bindings.node] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/Chetan/.nvm/versions/node/v8.11.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Darwin 18.2.0
gyp ERR! command "/Users/Chetan/.nvm/versions/node/v8.11.1/bin/node" "/Users/Chetan/.nvm/versions/node/v8.11.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/Chetan/Documents/code/pdf2ecml/node_modules/java
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN PDFTOECML@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! java@0.8.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the java@0.8.0 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/Chetan/.npm/_logs/2019-01-09T06_18_10_480Z-debug.log

pdf2ecml on  development is 📦 v1.0.0 via ⬢ v8.11.1 took 12s




pdf2ecml on  development is 📦 v1.0.0 via ⬢ v8.11.1


pdf2ecml on  development is 📦 v1.0.0 via ⬢ v8.11.1


pdf2ecml on  development is 📦 v1.0.0 via ⬢ v8.11.1
➜ ls -l `which java`

lrwxr-xr-x 1 root wheel 74 Jun 5 2018 /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java

pdf2ecml on  development is 📦 v1.0.0 via ⬢ v8.11.1
➜ /usr/libexec/java_home -v 1.8

/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home

pdf2ecml on  development is 📦 v1.0.0 via ⬢ v8.11.1
➜ /usr/libexec/java_home -V

Matching Java Virtual Machines (4):
11.0.1, x86_64: "OpenJDK 11.0.1" /Library/Java/JavaVirtualMachines/openjdk-11.0.1.jdk/Contents/Home
10.0.1, x86_64: "Java SE 10.0.1" /Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home
1.8.0_192, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home
1.8.0_191, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home

/Library/Java/JavaVirtualMachines/openjdk-11.0.1.jdk/Contents/Home

pdf2ecml on  development is 📦 v1.0.0 via ⬢ v8.11.1
➜ export JAVA_HOME=$(/usr/libexec/java_home -v 1.8.0)


pdf2ecml on  development is 📦 v1.0.0 via ⬢ v8.11.1
➜ java -version
java version "1.8.0_192"
Java(TM) SE Runtime Environment (build 1.8.0_192-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.192-b12, mixed mode)

pdf2ecml on  development is 📦 v1.0.0 via ⬢ v8.11.1
➜ ll
total 104
-rw-r--r-- 1 Chetan staff 33B Jan 8 12:58 README.md
drwxr-xr-x 6 Chetan staff 192B Jan 8 12:58 config
drwxr-xr-x 5 Chetan staff 160B Jan 8 12:58 documentation
-rw-r--r-- 1 Chetan staff 6.5K Jan 8 12:58 image2ecml.js
drwxr-xr-x 4 Chetan staff 128B Jan 8 12:58 input
drwxr-xr-x 96 Chetan staff 3.0K Jan 9 11:48 node_modules
-rw-r--r-- 1 Chetan staff 30K Jan 8 12:58 package-lock.json
-rw-r--r-- 1 Chetan staff 460B Jan 8 12:58 package.json
-rw-r--r-- 1 Chetan staff 3.2K Jan 8 12:58 pdf2Image.js

pdf2ecml on  development is 📦 v1.0.0 via ⬢ v8.11.1
➜ rm -R node_modules

pdf2ecml on  development is 📦 v1.0.0 via ⬢ v8.11.1
➜ npm i

> java@0.8.0 install /Users/Chetan/Documents/code/pdf2ecml/node_modules/java
> node-gyp rebuild

gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
CXX(target) Release/obj.target/nodejavabridge_bindings/src/java.o
../src/java.cpp:897:40: warning: 'ToNumber' is deprecated [-Wdeprecated-declarations]
v8::Local<v8::Number> val = info[0]->ToNumber();
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8.h:2333:10: note: 'ToNumber' has been explicitly marked deprecated here
inline V8_DEPRECATED("Use maybe version", Local<Number> ToNumber() const);
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
../src/java.cpp:927:40: warning: 'ToNumber' is deprecated [-Wdeprecated-declarations]
v8::Local<v8::Number> val = info[0]->ToNumber();
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8.h:2333:10: note: 'ToNumber' has been explicitly marked deprecated here
inline V8_DEPRECATED("Use maybe version", Local<Number> ToNumber() const);
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
../src/java.cpp:956:40: warning: 'ToNumber' is deprecated [-Wdeprecated-declarations]
v8::Local<v8::Number> val = info[0]->ToNumber();
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8.h:2333:10: note: 'ToNumber' has been explicitly marked deprecated here
inline V8_DEPRECATED("Use maybe version", Local<Number> ToNumber() const);
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
../src/java.cpp:983:42: warning: 'ToNumber' is deprecated [-Wdeprecated-declarations]
v8::Local<v8::Number> val = info[0]->ToNumber();
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8.h:2333:10: note: 'ToNumber' has been explicitly marked deprecated here
inline V8_DEPRECATED("Use maybe version", Local<Number> ToNumber() const);
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
../src/java.cpp:1019:40: warning: 'ToNumber' is deprecated [-Wdeprecated-declarations]
v8::Local<v8::Number> val = info[0]->ToNumber();
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8.h:2333:10: note: 'ToNumber' has been explicitly marked deprecated here
inline V8_DEPRECATED("Use maybe version", Local<Number> ToNumber() const);
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
../src/java.cpp:1044:40: warning: 'ToNumber' is deprecated [-Wdeprecated-declarations]
v8::Local<v8::Number> val = info[0]->ToNumber();
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8.h:2333:10: note: 'ToNumber' has been explicitly marked deprecated here
inline V8_DEPRECATED("Use maybe version", Local<Number> ToNumber() const);
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
../src/java.cpp:1263:16: warning: 'TryCatch' is deprecated [-Wdeprecated-declarations]
v8::TryCatch tryCatch;
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8.h:8313:3: note: 'TryCatch' has been explicitly marked deprecated here
V8_DEPRECATED("Use isolate version", TryCatch());
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
7 warnings generated.
CXX(target) Release/obj.target/nodejavabridge_bindings/src/javaObject.o
../src/javaObject.cpp:116:47: warning: 'NewInstance' is deprecated [-Wdeprecated-declarations]
v8::Local<v8::Object> javaObjectObj = ctor->NewInstance();
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8.h:3851:3: note: 'NewInstance' has been explicitly marked deprecated here
V8_DEPRECATED("Use maybe version", Local<Object> NewInstance() const);
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
../src/javaObject.cpp:349:47: warning: 'NewInstance' is deprecated [-Wdeprecated-declarations]
v8::Local<v8::Object> javaObjectObj = ctor->NewInstance();
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8.h:3851:3: note: 'NewInstance' has been explicitly marked deprecated here
V8_DEPRECATED("Use maybe version", Local<Object> NewInstance() const);
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
2 warnings generated.
CXX(target) Release/obj.target/nodejavabridge_bindings/src/javaScope.o
CXX(target) Release/obj.target/nodejavabridge_bindings/src/methodCallBaton.o
CXX(target) Release/obj.target/nodejavabridge_bindings/src/nodeJavaBridge.o
CXX(target) Release/obj.target/nodejavabridge_bindings/src/utils.o
../src/utils.cpp:347:21: warning: 'ToInt32' is deprecated [-Wdeprecated-declarations]
jint val = arg->ToInt32()->Value();
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8.h:2341:10: note: 'ToInt32' has been explicitly marked deprecated here
inline V8_DEPRECATED("Use maybe version", Local<Int32> ToInt32() const);
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
../src/utils.cpp:354:24: warning: 'ToNumber' is deprecated [-Wdeprecated-declarations]
jdouble val = arg->ToNumber()->Value();
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8.h:2333:10: note: 'ToNumber' has been explicitly marked deprecated here
inline V8_DEPRECATED("Use maybe version", Local<Number> ToNumber() const);
^
/Users/Chetan/.node-gyp/8.11.1/include/node/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
2 warnings generated.
SOLINK_MODULE(target) Release/nodejavabridge_bindings.node

> java@0.8.0 postinstall /Users/Chetan/Documents/code/pdf2ecml/node_modules/java
> node postInstall.js


> node-pdfbox@0.1.9 postinstall /Users/Chetan/Documents/code/pdf2ecml/node_modules/node-pdfbox
> node post-install


npm WARN PDFTOECML@1.0.0 No repository field.

added 113 packages in 12.975s

pdf2ecml on  development [!] is 📦 v1.0.0 via ⬢ v8.11.1 took 14s
➜ ll
total 104
-rw-r--r-- 1 Chetan staff 33B Jan 8 12:58 README.md
drwxr-xr-x 6 Chetan staff 192B Jan 8 12:58 config
drwxr-xr-x 5 Chetan staff 160B Jan 8 12:58 documentation
-rw-r--r-- 1 Chetan staff 6.5K Jan 8 12:58 image2ecml.js
drwxr-xr-x 4 Chetan staff 128B Jan 8 12:58 input
drwxr-xr-x 110 Chetan staff 3.4K Jan 9 11:51 node_modules
-rw-r--r-- 1 Chetan staff 30K Jan 9 11:51 package-lock.json
-rw-r--r-- 1 Chetan staff 460B Jan 8 12:58 package.json
-rw-r--r-- 1 Chetan staff 3.2K Jan 8 12:58 pdf2Image.js

pdf2ecml on  development [!] is 📦 v1.0.0 via ⬢ v8.11.1
➜ npm list --depth=0
PDFTOECML@1.0.0 /Users/Chetan/Documents/code/pdf2ecml
├── app-root-path@2.1.0
├── async@2.6.1
├── express@4.16.4
├── get-urls@8.0.0
├── morgan@1.9.0
├── node-pdfbox@0.1.9
├── uuid@3.3.2
└── winston@3.0.0


pdf2ecml on  development [!] is 📦 v1.0.0 via ⬢ v8.11.1
➜ npm install --save node-pdfbox


> node-pdfbox@0.1.9 postinstall /Users/Chetan/Documents/code/pdf2ecml/node_modules/node-pdfbox
> node post-install


npm WARN PDFTOECML@1.0.0 No repository field.

+ node-pdfbox@0.1.9
updated 1 package in 4.847s

pdf2ecml on  development [!] is 📦 v1.0.0 via ⬢ v8.11.1 took 5s

Issue was with the version of java installed on the system. I was using jabba for having different versions of Java on my system, but the versions which are installed using jabba weren’t having jni dependencies.
To list versions of Java installed on the system
/usr/libexec/java_home -V
Set JAVA_HOME to desired version of JAVA
export JAVA_HOME=$(/usr/libexec/java_home -v 1.8.0)
Check Java version currently active
➜ java -version java version "1.8.0_192" Java(TM) SE Runtime Environment (build 1.8.0_192-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.192-b12, mixed mode)

Reference links:
https://github.com/shyiko/jabba/issues/378
https://github.com/nodejs/node-gyp/issues/1641
https://stackoverflow.com/questions/9704376/how-to-install-java-native-development-headers-on-os-x-lion
https://github.com/emabrey/jni-headers