I'm not able to install new plugins in Phonegap with the command: $ phonegap plugin add **.
For example, when I run $ phonegap plugin add cordova.plugins.diagnostic, the following error occurs:
Installing "cordova.plugins.diagnostic" for browser
Unable to load PlatformApi from platform. Error: Cannot find module '/Users/george/Documents/phonegap/TryPushNotifications/platforms/browser/cordova/Api.js'
Failed to install 'cordova.plugins.diagnostic': Error: Unhandled "error" event. (The platform "browser" does not appear to be a valid cordova platform. It is missing API.js. browser not supported.)
at EventEmitter.emit (events.js:185:19)
at EventEmitter.module.exports.emit (/usr/local/lib/node_modules/phonegap/node_modules/cordova-common/src/events.js:71:17)
at Object.getPlatformApiFunction (/usr/local/lib/node_modules/phonegap/node_modules/cordova-lib/src/cordova/util.js:500:20)
at Object.getPlatformApi (/usr/local/lib/node_modules/phonegap/node_modules/cordova-lib/src/platforms/platforms.js:55:25)
at handleInstall (/usr/local/lib/node_modules/phonegap/node_modules/cordova-lib/src/plugman/install.js:593:29)
at /usr/local/lib/node_modules/phonegap/node_modules/cordova-lib/src/plugman/install.js:357:28
at _fulfilled (/usr/local/lib/node_modules/phonegap/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/phonegap/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/phonegap/node_modules/q/q.js:749:13)
at /usr/local/lib/node_modules/phonegap/node_modules/q/q.js:509:49
Error: Unhandled "error" event. (The platform "browser" does not appear to be a valid cordova platform. It is missing API.js. browser not supported.)
It seems like Phonegap didn't add a valid browser file, but I also try to create a new project with the phonegap command (which automatically creates a new push notifications project and same result).
How can I solve this?
Thank you.