ionic-team / ionic-team/ionic-cli

Issue with installing cordova plugins using ionic cordova add plugin

未關閉
#2,902 7 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
TypeScript
星號
2k
分支
682
PR 合併指標
30 天內沒有已合併 PR

描述

**Description:**
Unable to install cordova plugins using `ionic cordova add plugin`. I get the errors for every plugin I try to install this way.

**Steps to Reproduce:**
Install a plugin using `ionic cordova add plugin`. I have tried this thousands of times, tried upgrading to the latest cordova, but nothing help, unless I install the plugins using `cordova add plugin`

**Output:**
```
Error: Text data outside of root node.
Line: 178
Column: 1
Char: n
at error (/Users/jacques/dev/mobile/node_modules/elementtree/node_modules/sax/lib/sax.js:666:10)
at strictFail (/Users/jacques/dev/mobile/node_modules/elementtree/node_modules/sax/lib/sax.js:692:7)
at Object.write (/Users/jacques/dev/mobile/node_modules/elementtree/node_modules/sax/lib/sax.js:1035:15)
at XMLParser.feed (/Users/jacques/dev/mobile/node_modules/elementtree/lib/parsers/sax.js:48:15)
at ElementTree.parse (/Users/jacques/dev/mobile/node_modules/elementtree/lib/elementtree.js:271:10)
at Object.parse (/Users/jacques/dev/mobile/node_modules/elementtree/lib/elementtree.js:584:8)
at Function. (/Users/jacques/dev/mobile/node_modules/@ionic/cli-utils/lib/cordova/config.js:35:28)
at next (native)
at fulfilled (/Users/jacques/dev/mobile/node_modules/tslib/tslib.js:100:62)
```

**My `ionic info`:**
```
cli packages: (/Users/jacques/dev/mobile/node_modules)

@ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0

global packages:

cordova (Cordova CLI) : 6.5.0
Gulp CLI : CLI version 3.9.1 Local version 3.9.1

local packages:

Cordova Platforms : none
Ionic Framework : ionic1 1.3.5

System:

ios-deploy : 1.9.2
Node : v6.11.0
npm : 2.15.12
OS : macOS High Sierra
Xcode : Xcode 9.1 Build version 9B55
```

貢獻指南

開啟貢獻指南

研究方向

Start by reproducing `ionic cordova add plugin` with the versions in the report and inspect `node_modules/@ionic/cli-utils/lib/cordova/config.js`, where the stack trace enters XML parsing. Compare the input handled there with the successful `cordova add plugin` path and use the reported `elementtree` error to identify the malformed data. Done means Ionic can install the plugin without the parser error.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
typescript
領域
cli, tooling
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。