Thursday, December 7, 2017

Error: Text data outside of root node - when installing cordova plugin

Leave a Comment

I sometimes get an error when trying to install any cordova plugin ionic (usually after around 6pm GMT+0).

These are with plugins from both npm and GitHub, and the error I get is:

Error: Text data outside of root node. Line: 155 Column: 1 Char: " 

The install command will be something along the lines of

ionic cordova plugin add cordova-plugin-network-information@1.3.1

It really does not matter what plugin it is, because as mentioned it happens for a number of them, they all get the same error. It will work perfectly ok in the morning, and then suddenly it shuts down.

I have tried on multiple computers, on multiple separate internet connections (from the UK), and I even have a script that reruns the commands if they fail, so it will attempt to install around 20 plugins continuously until they get installed for however long I run my script. I ran it for an hour constantly, and not a single one was installed.

I also checked the status of npm and GitHub if they were perhaps down, but they seemed to be up and running as usual...

Any ideas would be greatly appreciated

1 Answers

Answers 1

* Based on my comment which helped the asker, and which I was asked to publish as an answer:*

I don't know ionic at all, but I do have some experience with Cordova and never had any issues installing plugins, even on a corporate network.

Try to install the plugin without ionic.

cordova plugin add my.plugin.name 
If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment