You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 1, 2018. It is now read-only.
In some cases after executing ionic platform add iOS we can get the following error:
Running command: /Users/zwacky/data/mc-webapp/mobile/hooks/after_prepare/020_remove_sass_from_platforms.js /Users/zwacky/data/mc-webapp/mobile
Error: Cannot find module 'xml2js'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at /Users/zwacky/data/mc-webapp/mobile/plugins/cordova-hot-code-push-plugin/scripts/lib/chcpConfigXmlReader.js:8:14
at Object.<anonymous> (/Users/zwacky/data/mc-webapp/mobile/plugins/cordova-hot-code-push-plugin/scripts/lib/chcpConfigXmlReader.js:71:3)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
node -v
v0.12.2
npm -v
2.13.2
For some reasons node module xml2js is not installed.
As a solution you can just add it manually:
npm install xml2js
But this should be done by the plugin after the installation.
This behaviour will change in next release: plugin will install required npm modules in plugin's folder instead of the project's folder. Just like regular npm modules does that.
Activity
nikDemyankov commentedon Nov 5, 2015
@zwacky can you provide step-by-step guide on how to reproduce it?
zwacky commentedon Nov 5, 2015
i just tried it and if i use
ionic plugin add cordova-hot-code-push-plugin
i get the aforementioned bug (and some more).cordova plugin add cordova-hot-code-push-plugin
though checks for read-package-json and xml2js. ionic people usually use ionic rather than cordova.nikDemyankov commentedon Nov 5, 2015
What ionic version you are using?
zwacky commentedon Nov 5, 2015
ionic -v
nikDemyankov commentedon Nov 5, 2015
Just tried the following:
ionic start Test blank cd ./Test ionic platform add ios ionic platform add android ionic plugin add cordova-hot-code-push-plugin
And it installed all the required modules. You do the same and get the error?
zwacky commentedon Nov 5, 2015
installing from a fresh install does work. sigh.
can't reproduce anymore.
nikDemyankov commentedon Nov 10, 2015
Closing that weird issue. Released v1.1.0, made some changes in the node modules installation process.
dongdh commentedon Apr 2, 2016
it seems that the plugin install xml2js in local folder, it seems it doesn't go find the globally installed xml2js.
nikDemyankov commentedon Apr 3, 2016
This behaviour will change in next release: plugin will install required npm modules in plugin's folder instead of the project's folder. Just like regular npm modules does that.
ghost commentedon Aug 30, 2017
I had the same issue and I solved with this command "npm install xml2js --save"