I'm just trying Ionic for the first time and I keep getting this error:
alex@mypc ~/Trashable/testApp $ sudo ionic build android
[sudo] password for alex:
module.js:340
throw err;
^
Error: Cannot find module 'bplist-parser'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:289:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object. (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js:20:14)
at Module._compile (module.js:425:26)
at Object.Module._extensions..js (module.js:432:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
when building a test Ionic application for my Android physical device (HTC Sensation, Android 4.03) connected via USB (USB debug is enabled).
The mentioned "bplist-parser" file is actually missing on my system (both in /lib and in /usr/local/lib). Honestly, I do not know how to install it if not using npm.
My system is as follow:
alex@mypc ~/Trashable/testApp $ npm --version
3.5.2
alex@mypc ~/Trashable/testApp $ node --version
v5.1.1
alex@mypc ~/Trashable/testApp $ lsb_release --all
LSB Version: core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch:core-4.1-amd64:core-4.1-noarch:security-4.0-amd64:security-4.0-noarch:security-4.1-amd64:security-4.1-noarch
Distributor ID: LinuxMint
Description: Linux Mint 17.1 Rebecca
Release: 17.1
Codename: rebecca
Cordova is installed, as required:
alex@mypc ~/Trashable/testApp $ sudo npm install -g cordova
/usr/bin/cordova -> /usr/lib/node_modules/cordova/bin/cordova
/usr/lib
└── cordova@5.4.1
(I have a working instance of the official Google Android Studio installed on this Linux Box, as well.)
But, of course, Cordova does not work:
alex@mypc ~/Trashable/testApp $ sudo cordova
module.js:340
throw err;
^
Error: Cannot find module 'bplist-parser'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:289:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object. (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js:20:14)
at Module._compile (module.js:425:26)
at Object.Module._extensions..js (module.js:432:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
I googled around a little bit and I found and tried a few possible solutions:
1) cleaning up and reinstalling everything via npm (never removing node_modules by hand, anyway)
2) upgrading everything via npm
3) sudo ln -s /usr/local/lib/node_modules/ /lib/node_modules (of course, it does not work because of the missing file...)
4) issuing the required installation commands with sudo or as a normal user, with or without the "-g" key (global install).
No way...
Any suggestion?