I started getting this error after updating from cordova v6.5.x to the latest.
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.
[ERROR] An error occurred while running cordova platform add android --save
(exit code 1):
Using cordova-fetch for cordova-android@^6.1.2 Error: Failed to fetch platform cordova-android@^6.1.2 Probably this is either a connection problem, or platform spec is incorrect. Check your connection and platform name/version/URL. Error: cmd: Command failed with exit code 1 Error output: '"C:\Program Files\nodejs\npm"' is not recognized as an internal or external command, operable program or batch file.