question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find module 'xml2js'

See original GitHub issue

I’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:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ethanneffcommented, Aug 17, 2017

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:

npm i -g cordova@7.0.1
cordova platform update android@6.2.3
0reactions
mackbrownecommented, Aug 8, 2017

thanks @ethanneff !!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node.JS cannot find module 'xml2js' (Windows) - Stack Overflow
Need to do parsing xml-file using Node. js. Using a library for parsing xml2js. Xml2js installed using the command "npm install xml2js".
Read more >
xml2js - npm
Simple XML to JavaScript object converter. It supports bi-directional conversion. Uses sax-js and xmlbuilder-js. Note: If you're looking for a ...
Read more >
Node.js cannot find module xml2js - iTecNote
I made an application on my machine, and it works well. I uploaded it to the server, and it is crashing with the...
Read more >
AWS Lambda Function is returning “Cannot find module 'index ...
As my title explains I am getting the following error: { "errorMessage": "Cannot find module ... And yet still does not work with...
Read more >
Ionic Forum - Ionic Framework
... Unhandled promise rejection (rejection id: 1): Error: Cannot find module '../node_modules/xml2js' (node:42689…
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found