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

xml2js is not installed #35

Closed
Closed
@nikDemyankov

Description

@nikDemyankov
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.

Activity

added this to the v1.1.0 milestone on Nov 5, 2015
nikDemyankov

nikDemyankov commented on Nov 5, 2015

@nikDemyankov
MemberAuthor

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

zwacky

zwacky commented on Nov 5, 2015

@zwacky

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

nikDemyankov commented on Nov 5, 2015

@nikDemyankov
MemberAuthor

What ionic version you are using?

zwacky

zwacky commented on Nov 5, 2015

@zwacky

ionic -v

1.7.7

nikDemyankov

nikDemyankov commented on Nov 5, 2015

@nikDemyankov
MemberAuthor

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

zwacky commented on Nov 5, 2015

@zwacky

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

nikDemyankov

nikDemyankov commented on Nov 10, 2015

@nikDemyankov
MemberAuthor

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

dongdh

dongdh commented on Apr 2, 2016

@dongdh

it seems that the plugin install xml2js in local folder, it seems it doesn't go find the globally installed xml2js.

nikDemyankov

nikDemyankov commented on Apr 3, 2016

@nikDemyankov
MemberAuthor

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

ghost commented on Aug 30, 2017

@ghost

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @zwacky@dongdh@nikDemyankov

        Issue actions

          xml2js is not installed · Issue #35 · nordnet/cordova-hot-code-push