作者:mmmmmmmmmm0000 | 来源:互联网 | 2023-01-07 09:29
我尝试使用mac os终端更新cordova中的任何插件时遇到问题.当我尝试运行命令时,cordova plugin add xxxxxxx
它告诉我我的android/ios都不是有效的cordova平台.
我的节点版本是v9.2.0,NPM版本是5.5.1,Cordova版本是7.1.0.我对如何进行感到茫然.谁能提供一些见解?
? steve git:(master) ? cordova plugin add https://github.com/danwilson/google-analytics-plugin.git
Installing "cordova-plugin-google-analytics" for ios
Unable to load PlatformApi from platform. Error: Cannot find module '/Users/rsteve/Desktop/steve/platforms/ios/cordova/Api.js'
Failed to install 'cordova-plugin-google-analytics': 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 (/usr/local/lib/node_modules/cordova/node_modules/cordova-common/src/events.js:71:17)
at Object.getPlatformApiFunction (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/util.js:500:20)
at Object.getPlatformApi (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/platforms/platforms.js:55:25)
at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:593:29)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:357:28
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:509:49
错误:未处理的错误.(平台"ios"似乎不是一个有效的cordova平台.它缺少API.js.不支持.)