[8.1.2] All platform script errors lead to message "Unable to load ... does not appear to be a valid cordova platform"
- Dominant language
- JavaScript
- Stars
- 967
- Forks
- 344
- Avg merge
- 8h 41m
- Merged PRs (30d)
- 9
Description
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.
Contributor guide
Research direction
Start by reproducing `cordova build ios` in the reported case where `node_modules` is missing, then trace the platform-loading error around `API.js`. Check how the initial `Cannot find module 'unorm'` failure becomes the later invalid-platform message. Done means platform script failures retain their actual cause instead of being reported as a missing or invalid Cordova platform.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100