cordova-cli
cordova-cli copied to clipboard
[8.1.2] All platform script errors lead to message "Unable to load ... does not appear to be a valid cordova platform"
When there is any problem in the platform scripts, e.g. because you deleted node_modules, you get this error:
MacBook-Pro:cordovaIos5Test2 sujan$ cordova build ios
Unable to load PlatformApi from platform. Error: Cannot find module 'unorm'
Unhandled error. (The platform "ios" does not appear to be a valid cordova platform. It is missing API.js. ios not supported.)
The first bit is true, but the second one not really.
Any updates here? I just get the same error, for CLI version 8.1.2
> cordova prepare android Unable to load PlatformApi from platform. Error: Cannot find module 'properties-parser' Unhandled error. (The platform "android" does not appear to be a valid cordova platform. It is missing API.js. android not supported.)
You are not getting the same error, yours is about a specific module missing for some reason. Open a new issue so we can look into this specific problem - this issue here is for the whole class of errors that get a misleading output in general.
Same issue here on updating cordova version to 9.0.0
Unable to load PlatformApi from platform. Error: Cannot find module 'properties-parser' Unhandled error. (The platform "android" does not appear to be a valid cordova platform. It is missing API.js. android not supported.)