cordova-cli icon indicating copy to clipboard operation
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"

Open janpio opened this issue 6 years ago • 3 comments

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.

janpio avatar Feb 19 '19 20:02 janpio

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.)

ionut-movila avatar Feb 28 '19 13:02 ionut-movila

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.

janpio avatar Feb 28 '19 13:02 janpio

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.)

bandhavya avatar Jan 01 '20 10:01 bandhavya