Skip to content
This repository was archived by the owner on Oct 1, 2018. It is now read-only.

xml2js is not installed #35

Closed
nikDemyankov opened this issue Nov 5, 2015 · 10 comments
Closed

xml2js is not installed #35

nikDemyankov opened this issue Nov 5, 2015 · 10 comments
Labels
Milestone

Comments

@nikDemyankov
Copy link
Member

Issue from pull request #33.

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.

@nikDemyankov nikDemyankov added this to the v1.1.0 milestone Nov 5, 2015
@nikDemyankov
Copy link
Member Author

@zwacky can you provide step-by-step guide on how to reproduce it?

@zwacky
Copy link

zwacky commented 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
Copy link
Member Author

What ionic version you are using?

@zwacky
Copy link

zwacky commented Nov 5, 2015

ionic -v

1.7.7

@nikDemyankov
Copy link
Member Author

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
Copy link

zwacky commented Nov 5, 2015

installing from a fresh install does work. sigh.
can't reproduce anymore.

@nikDemyankov
Copy link
Member Author

Closing that weird issue. Released v1.1.0, made some changes in the node modules installation process.

@dongdh
Copy link

dongdh commented 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
Copy link
Member Author

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.

@contact2sale
Copy link

I had the same issue and I solved with this command "npm install xml2js --save"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants