Closed Dhanasekaranjones closed 6 years ago
The command is failing because the package.json file for this repo is invalid
If you validate the package.json for that repo using http://package-json-validator.com/ (enter the github repo as https://github.com/guyromb/Cordova-open-native-settings
), then it tells you why:
Results:
{
"valid": false,
"errors": [
"contributors field should have name",
"contributors field should have name",
"contributors field should have name",
"contributors field should have name",
"contributors field should have name",
"contributors field should have name",
"Type for field engines, was expected to be object, not object"
],
"recommendations": [
"Missing optional field: dependencies"
]
}
The username
key has been used instead of name
in the contributors
list.
Therefore the cordova-check-plugins
tool cannot update the plugin, because the npm view
command it uses to check the current version fails due to the invalid package.json.
How to update cordova-plugins one by one? Else give the update command line without Cordova-open-native-settings. For ex: camera,network-plugin etc.
a space-separated list of multiple plugin IDs
For example:
cordova-check-plugins --update="cordova-plugin-camera cordova-plugin-dialogs cordova-plugin-geolocation"
This command is given install after showing the error:
*********************************
* Error checking plugin version *
*********************************
plugin: com.phonegap.plugins.nativesettingsopener
source: https://github.com/guyromb/Cordova-open-native-settings.git
installed version: 1.3
remote version: 1.4.1
error: Error comparing versions: local version=1.3; target version=1.4.1; versio
n error=Invalid Version: 1.3
plugin: cordova-open-native-settings
source: npm://https://github.com/guyromb/Cordova-open-native-settings.git
installed version: UNKNOWN
remote version: UNKNOWN
error: Failed to check npm registry for plugin 'cordova-open-native-settings': E
rror: Command failed: npm view "https://github.com/guyromb/Cordova-open-native-s
ettings.git" version
npm ERR! Invalid package.json
┌───────────────────────────────────────────────────────────────────────────────
┐
│ npm update check failed
│
│ Try running with sudo or get access
│
│ to the local update config store via
│
│ sudo chown -R $USER:$(id -gn $USER) C:\Users\administrator.WBCDNS.000\.config
│
└───────────────────────────────────────────────────────────────────────────────
┘
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\administrator.WBCDNS.000\AppData\Roaming\npm-cache\_logs\2
017-09-22T07_57_45_322Z-debug.log
plugin: cordova-plugin-camera
source: npm://cordova-plugin-camera
installed version: UNKNOWN - check plugins/fetch.json for orphaned entries
remote version: 2.4.1```
plugin: com.phonegap.plugins.nativesettingsopener
source: https://github.com/guyromb/Cordova-open-native-settings.git
installed version: 1.3
remote version: 1.4.1
error: Error comparing versions: local version=1.3; target version=1.4.1; versio
n error=Invalid Version: 1.3
1.3
is an invalid version: npm pacakges must use Semantic Versioning i.e. X.Y.Z
. 1.3
is X.Y
which is an invalid version, so the semver module used by cordova-check-plugins
cannot parse it.
plugin: cordova-open-native-settings
source: npm://https://github.com/guyromb/Cordova-open-native-settings.git
installed version: UNKNOWN
remote version: UNKNOWN
error: Failed to check npm registry for plugin 'cordova-open-native-settings': E
rror: Command failed: npm view "https://github.com/guyromb/Cordova-open-native-s
ettings.git" version
npm ERR! Invalid package.json
As previously described: invalid package.json
plugin: cordova-plugin-camera
source: npm://cordova-plugin-camera
installed version: UNKNOWN - check plugins/fetch.json for orphaned entries
remote version: 2.4.1
This means an entry for cordova-plugin-camera
is found in plugins/fetch.json
but no installed plugin was found at plugins/cordova-plugin-camera
, so the tool is unable to compare local vs remote versions. Add cordova-plugin-camera
manually first using cordova plugin add cordova-plugin-camera --force
.
Thank a bunch.
I will fix it asap
@dpa99c fixed package.json validity.
I have used the older version cordova-plugins
Now i have update the all cordova-plugins in single command line using like
cordova-check-plugins --update=auto --force
But use the command line to install after Error showing:
plugin: cordova-open-native-settings source: npm://https://github.com/guyromb/Cordova-open-native-settings.git installed version: UNKNOWN remote version: UNKNOWN error: Failed to check npm registry for plugin 'cordova-open-native-settings': E rror: Command failed: npm view "https://github.com/guyromb/Cordova-open-native-s ettings.git" version npm ERR! Invalid package.json
How to solve the error and give the cordova-plugins update url.