gpt4 book ai didi

ios - Cordova 无法添加插件 : Error: Cannot find module 'unorm'

转载 作者:行者123 更新时间:2023-11-29 11:35:37 27 4
gpt4 key购买 nike

我正在尝试将插件添加到我的 cordova 应用程序,但我收到一条错误消息“平台“ios”似乎不是有效的 cordova 平台。它缺少 API.js。ios 不受支持。”

node --version
v9.2.0

cordova --version
8.0.0

这是我正在运行的命令

cordova plugin add cordova-plugin-appinfo

以及完整的输出:

Installing "cordova-plugin-appinfo" for ios
Unable to load PlatformApi from platform. Error: Cannot find module 'unorm'
Failed to install 'cordova-plugin-appinfo': Error [ERR_UNHANDLED_ERROR]: Unhandled error. (The platform "ios" does not appear to be a valid cordova platform. It is missing API.js. ios not supported.)
at EventEmitter.emit (events.js:140:19)
at EventEmitter.module.exports.emit (/Users/james/.nvm/versions/node/v9.2.0/lib/node_modules/cordova/node_modules/cordova-common/src/events.js:71:17)
at Object.getPlatformApiFunction (/Users/james/.nvm/versions/node/v9.2.0/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/util.js:499:20)
at Object.getPlatformApi (/Users/james/.nvm/versions/node/v9.2.0/lib/node_modules/cordova/node_modules/cordova-lib/src/platforms/platforms.js:55:25)
at handleInstall (/Users/james/.nvm/versions/node/v9.2.0/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:593:29)
at /Users/james/.nvm/versions/node/v9.2.0/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:357:28
at _fulfilled (/Users/james/.nvm/versions/node/v9.2.0/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/Users/james/.nvm/versions/node/v9.2.0/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/Users/james/.nvm/versions/node/v9.2.0/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:749:13)
at /Users/james/.nvm/versions/node/v9.2.0/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:509:49
(node:35697) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Unhandled error. (The platform "ios" does not appear to be a valid cordova platform. It is missing API.js. ios not supported.)
(node:35697) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

我确定这是一个有效的 Cordova 项目并且 iOS 平台似乎工作正常(我可以在 iPhone 上构建和运行)。

最佳答案

我在尝试更新 ios 平台后遇到了同样的错误。事实证明,node_modules 下载缓存中存在一些损坏。我通过第二次尝试解决了这个问题:

cordova platform rm ios 
cordova platform add ios@latest

关于ios - Cordova 无法添加插件 : Error: Cannot find module 'unorm' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49522649/

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