科尔多瓦要求投掷' foreach'未定义

时间:2017-12-19 20:39:40

标签: cordova

运行cordova requirements browser命令时,出现错误说明: 错误:无法读取属性' forEach'未定义的。它没有告诉我错误源自何处,也没有--debug属性的要求。就我而言,这个错误可能来自我项目中的任何文件...

2 个答案:

答案 0 :(得分:0)

您可以安装cordova 8.1.2,它将显示带有-d的堆栈跟踪,例如:

$ cordova requirements -d
PlatformApi successfully found for platform browser
PlatformApi successfully found for platform ios

Requirements check results for browser:
Cannot read property 'forEach' of undefined
TypeError: Cannot read property 'forEach' of undefined
    at /usr/local/lib/node_modules/cordova/src/cli.js:397:35
    at Array.map (<anonymous>)
    at /usr/local/lib/node_modules/cordova/src/cli.js:388:68
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:854:54)
    at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:883:30
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:13)
    at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:624:44
    at runSingle (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:137:13)
    at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:125:13)
    at process._tickCallback (internal/process/next_tick.js:61:11)

这可以帮助您找到错误

答案 1 :(得分:0)

这里也有报道: https://github.com/apache/cordova-browser/issues/65

尝试通过以下方式更新到最新的夜间版本:npm install --global cordova@nightly