Error: Cannot find module '../node_modules/xml2js'
See original GitHub issuehey i’m using ionic wrapper , and when i try to remove any plugin from my project it’s give me this error
node:43267) UnhandledPromiseRejectionWarning: Error: Cannot find module '../node_modules/xml2js'
at Function.Module._resolveFilename (module.js:543:15)
at Function.Module._load (module.js:470:25)
at Module.require (module.js:593:17)
at require (internal/module.js:11:18)
at module.exports (/Volumes/Partion/App/Projects/TucTop Application/TucTopFinal/plugins/cordova-plugin-googlemaps/src/before_plugin_rm.js:7:16)
at runScriptViaModuleLoader (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:188:18)
at runScript (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:164:16)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:132:20
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:816:30)
(node:43267) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:43267) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
when i’m go to mention file src/before_plugin_rm.js
i found that the require function get a wrong path for xml2js
var xml2js = require('../node_modules/xml2js');
when i correct the path from above line to this
var xml2js = require('../../../node_modules/xml2js');
the problem solved successfully
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:19 (10 by maintainers)
Top Results From Across the Web
Node.JS cannot find module 'xml2js' (Windows) - Stack Overflow
node_modules/xml2js exists. When you run npm install somemodule at D:/test , it will be stored to D:/test/node_modules/somemodule , then you ...
Read more >xml2js - npm
Simplest way to install xml2js is to use npm, just npm install xml2js which will download xml2js and all dependencies.
Read more >Failed to install 'cordova-plugin-firebasex': Error: Cannot find ...
when i ran cordova platform add ios get the error : Failed to install 'cordova-plugin-firebasex': Error: Cannot find module 'xml2js'.
Read more >Ionic Forum - Ionic Framework
Error : Cannot find module '../node_modules/xml2js' · Ionic Framework ionic-v3.
Read more >Node.js cannot find module xml2js - iTecNote
nextTick error, or 'error' event on first tick ^ Error: Cannot find module 'xml2js', in paths: /root/.node_modules,/root/.node_libraries,/usr/local/lib/node ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
i mentioned the solution above in
plugins/cordova-plugin-googlemaps/src/before_plugin_rm.js
replacevar xml2js = require('../node_modules/xml2js');
withvar xml2js = require('../../../node_modules/xml2js');
will solve the problem+1 Same problem here.