Cannot find module 'xml2js'
See original GitHub issueI’m trying to add this plugin to my cordova project and I’m getting the error “Error: Cannot find module ‘xml2js’” when trying to run cordova plugin add branch-cordova-sdk
. Working backwards it looks like this started in 2.6.1 and I can successfully install 2.6.0.
Full Error cordova plugin add branch-cordova-sdk@2.6.1 Fetching plugin “branch-cordova-sdk@2.6.1” via npm Installing “branch-cordova-sdk” for android BRANCH SDK: Installing node dependency xml2js Subproject Path: CordovaLib Failed to install ‘branch-cordova-sdk’:Error: Cannot find module ‘xml2js’ at Function.Module._resolveFilename (module.js:472:15) at Function.Module._load (module.js:420:25) at Module.require (module.js:500:17) at require (internal/module.js:20:19) at C:\Projects\CordovaTest\plugins\branch-cordova-sdk\src\scripts\lib\xmlHelper.js:5:16 at Object.<anonymous> (C:\Projects\CordovaTest\plugins\branch-cordova-sdk\src\scripts\lib\xmlHelper.js:49:3) at Module._compile (module.js:573:32) at Object.Module._extensions…js (module.js:582:10) at Module.load (module.js:490:32) at tryModuleLoad (module.js:449:12) Error: Cannot find module ‘xml2js’
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
Hello again,
I apologize for the delay. It appears these issues were related to Cordova. After making the following changes I was able to remove the errors:
thanks @ethanneff !!