Home:ALL Converter>Cordova add platform error, with android

Cordova add platform error, with android

Ask Time:2016-06-08T18:59:18         Author:Alexandru Pufan

Json Formatter

When I try tu run cordova platform add android, whether it's from a Ionic or Cordova Project, I get the following error:

/c/Users/USERNAME/AppData/Roaming/npm/cordova: line 14:  1200 Illegal instruction     node "$basedir/node_modules/cordova/bin/cordova" "$@"

This is my setup:

Cordova CLI: 6.2.0
Gulp version: CLI version 1.2.1
Gulp local:
Ionic CLI Version: 1.7.15
Ionic App Lib Version: 0.7.2
OS: Windows 7
Node Version: v4.4.0

These are my environment variables:

ANDROID_HOME: C:\Users\USERNAME\AppData\Local\Android\sdk
JAVA_HOME: C:\Program Files\Java\jdk1.8.0_92
Path: ;C:\Program Files (x86)\Microsoft VS Code\bin;%JAVA_HOME%\bin;C:\apache-ant-1.9.7\bin;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools;C:\Users\USERNAME\AppData\Roaming\npm

I've tried reinstalling cordova, ionic, npm and different versions of Node, but the error remains. Any ideas?

Author:Alexandru Pufan,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/37700618/cordova-add-platform-error-with-android
Gandhi :

\n I believe your nodejs installation folder is not set in your Path system environment variable. Please ensure to add the same.\n\n\nOnce its done, try executing node -v command from command prompt. You should be able to see the nodejs version. Once this command execution is successful, you shoule ba able to add android platform.",
2016-06-08T11:54:16
yy