dlbeswick opened a new issue, #423:
URL: https://github.com/apache/cordova/issues/423
# Bug Report
## Problem
### What is expected to happen?
Plugins can be added using the "cordova plugin add" command
### What does actually happen?
A single line of output is displayed: "Unexpected end of JSON input"
## Information
I've tracked this issue to `cordova-lib/src/cordova/plugin/util.js`, in the
"info" function. The call to `execa("npm", ...`) is returning no output.
However, this doesn't seem to be an issue with "execa" because other calls such
as "ls" are returning output fine.
If you change that line to the following:
return execa('bash', ['-c', `cat <(npm ${viewArgs.join(' ')})`])
Then it works. So I suspect it's something weird with npm or node's
behaviour, not flushing to stdout or something like that.
### Command or Code
`npx cordova plugin add cordova-plugin-device`
### Environment, Platform, Device
Ubuntu 22.04.2
### Version information
"node" Snap 18.16.1 (Rev 7588)
Node 18.16.1
NPM 9.5.1
Cordova 12.0.0
## 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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]