cumpstey opened a new issue #543:
URL: https://github.com/apache/cordova-cli/issues/543
# Bug Report
## Problem
Updating an existing project from Cordova 9 to 10, I get an error when
trying to add or remove a platform. Then tried with new Ionic project in clean
Node installation, and get the same error.
### What is expected to happen?
```
> cordova platform add android
```
The Android platform is added to the project.
```
> cordova platform remove android
```
The Android platform is removed from the project (or a message saying it's
not part of the project).
### What does actually happen?
```
ncumpstey@Apps-MBP test % cordova platform add android --verbose
No scripts found for hook "before_platform_add".
No version supplied. Retrieving version from config.xml...
Grabbing pinned version.
Using cordova-fetch for cordova-android@^9.0.0
fetch: Installing cordova-android@^9.0.0 to
/Users/ncumpstey/Documents/Projects/test
Failed to fetch platform cordova-android@^9.0.0
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
CordovaError: TypeError: Cannot assign to read only property 'valueOf' of
object '[object Object]'
CordovaError: Failed to fetch platform cordova-android@^9.0.0
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
CordovaError: TypeError: Cannot assign to read only property 'valueOf' of
object '[object Object]'
at
/Users/ncumpstey/.nvm/versions/node/v12.20.0/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/platform/addHelper.js:288:31
```
```
ncumpstey@Apps-MBP test % cordova platform remove android --verbose
No scripts found for hook "before_platform_rm".
Removing platform android from platforms.json file...
TypeError: Cannot assign to read only property 'valueOf' of object '[object
Object]'
at Function.defer
(/Users/ncumpstey/.nvm/versions/node/v12.20.0/lib/node_modules/cordova/node_modules/q/q.js:576:21)
at Object.exports.spawn
(/Users/ncumpstey/.nvm/versions/node/v12.20.0/lib/node_modules/cordova/node_modules/cordova-common/src/superspawn.js:64:17)
at
/Users/ncumpstey/.nvm/versions/node/v12.20.0/lib/node_modules/cordova/node_modules/cordova-fetch/index.js:177:31
CordovaError: TypeError: Cannot assign to read only property 'valueOf' of
object '[object Object]'
at
/Users/ncumpstey/.nvm/versions/node/v12.20.0/lib/node_modules/cordova/node_modules/cordova-fetch/index.js:180:19
```
## Information
### Command or Code
```
> cordova platform add android
> cordova platform remove android
```
### Environment, Platform, Device
Mac
### Version information
MacOS 10.15.7
Node 12.20.0 and 10.15.3 - same behaviour in both.
Cordova CLI 10.0.0
Ionic CLI 6.12.2
## Checklist
- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]