I tried installing the BarcodeScanner plugin. When I tried to install the Ionic wrapper:
Installing Ionic Native wrapper
npm install --save @ionic-native/barcode-scanner
I ran into an error, I’ve pasted it here:
The error
> canvas@1.6.11 install /Volumes/Development/clients/2018/vouchbase/mobile/fanapp_v2/fanapp/node_modules/canvas
> node-gyp rebuild
./util/has_lib.sh: line 31: pkg-config: command not found
gyp: Call to './util/has_lib.sh freetype' 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/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:336:16)
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 17.7.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 /Volumes/Development/clients/2018/vouchbase/mobile/fanapp_v2/fanapp/node_modules/canvas
gyp ERR! node -v v8.11.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: canvas@1.6.11 (node_modules/canvas):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: canvas@1.6.11 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
Current npm version
npm -v
5.6.0
Current cordova version
cordova -v
7.1.0
Ionic version
ionic -v
3.20.0
What i can see
I can see from the error that pkg-config
seems to be missing. I’ve installed this plugin before without this issue? Also, I don’t have Homebrew install, which seems to be the way to add pkg-config
. Preferably I don’t want to install Homebrew as it only caused me headaches in the past.
Any ideas?