gpt4 book ai didi

android - (Ionic 2) 尝试回退到 Cordova-lib 执行时发生错误 : TypeError: Cannot read property 'then' of undefined

转载 作者:可可西里 更新时间:2023-11-01 03:27:38 26 4
gpt4 key购买 nike

编辑: 使用 ionic 2 时会发生这种情况。我知道它还不稳定,但我认为可能有一些解决方法,因为其他人似乎没有得到这个问题。 编辑结束

出于某种原因,我在尝试构建我的 ionic 应用程序时突然开始出现此错误,使用“ionic build android”和“ionic build ios”:

An Error occurred trying to fall back to Cordova-lib execution: TypeError: Cannot read property 'then' of undefined
at Object.IonicTask.runCordova (/usr/local/lib/node_modules/ionic/lib/ionic/cordova.js:262:21)
at /usr/local/lib/node_modules/ionic/lib/ionic/cordova.js:142:19
at _fulfilled (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:749:13)
at /usr/local/lib/node_modules/ionic/node_modules/q/q.js:557:44
at flush (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:108:17)
at doNTCallback0 (node.js:430:9)
at process._tickCallback (node.js:359:13)

Error happened [TypeError: Cannot read property 'then' of undefined]
TypeError: Cannot read property 'then' of undefined
at Object.IonicTask.runCordova (/usr/local/lib/node_modules/ionic/lib/ionic/cordova.js:262:21)
at /usr/local/lib/node_modules/ionic/lib/ionic/cordova.js:142:19
at _fulfilled (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:749:13)
at /usr/local/lib/node_modules/ionic/node_modules/q/q.js:557:44
at flush (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:108:17)
at doNTCallback0 (node.js:430:9)
at process._tickCallback (node.js:359:13)

我在这里迷路了,不知道从哪里开始寻找。

有没有人以前见过这个,可以给我指明正确的方向?

最佳答案

@mabs @mgcdanny

我很确定我已经找出问题的根本原因。我运行了 cordova -v 并看到了这个输出 -

Ross-MBP:test rossmartin$ cordova -v
/usr/local/lib/node_modules/cordova/node_modules/update-notifier/node_modules/configstore/index.js:53
throw err;
^

Error: EACCES: permission denied, open '/Users/rossmartin/.config/configstore/update-notifier-cordova.json'
You don't have access to this file.

然后我跑了

Ross-MBP:test rossmartin$ sudo chown -R rossmartin ~/.config
Ross-MBP:test rossmartin$ cordova -v
6.0.0

现在我看到 cordova 报告它是 6.0.0 并且可以再次进行 ionic 构建/准备。

我认为发生的事情是 Ionic CLI 认为没有安装 cordova CLI。也许 Ionic CLI 在某处执行了 cordova -v 并被读取 ~/.config/configstore/update-notifier-cordova.json< 的权限问题挂断了 文件。

关于android - (Ionic 2) 尝试回退到 Cordova-lib 执行时发生错误 : TypeError: Cannot read property 'then' of undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34058245/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com