After so many attempts to add platform so that I run my app to test its native aspect on a physical device, I keep getting errors. I’ve been on this for almost a full day.
ionic cordova platform add android
hangs my system for about 4Hours without any result.
ionic add platform android
says [ERROR] Unable to find command: add platform android
cordova platform add android --save
gives the below error.
Using cordova-fetch for cordova-android@~6.2.2
Error: Failed to fetch platform cordova-android@~6.2.2
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
Error: npm: Command failed with exit code 243 Error output:
npm WARN checkPermissions Missing write access to /var/www/example.com/public_html/naice/node_modules
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! Linux 4.4.0-78-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "cordova-android@~6.2.2" "--save"
npm ERR! node v7.9.0
npm ERR! npm v4.2.0
npm ERR! path /var/www/example.com/public_html/naice/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/var/www/example.com/public_html/naice/node_modules'
npm ERR! { Error: EACCES: permission denied, access '/var/www/example.com/public_html/naice/node_modules'
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/var/www/example.com/public_html/naice/node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Linux 4.4.0-78-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "cordova-android@~6.2.2" "--save"
npm ERR! node v7.9.0
npm ERR! npm v4.2.0
npm ERR! path /home/bayo/.npm/_logs/2017-06-22T08_18_50_651Z-debug.log.2752372291
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall open
npm ERR! Error: EACCES: permission denied, open '/home/bayo/.npm/_logs/2017-06-22T08_18_50_651Z-debug.log.2752372291'
npm ERR! { Error: EACCES: permission denied, open '/home/bayo/.npm/_logs/2017-06-22T08_18_50_651Z-debug.log.2752372291'
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path: '/home/bayo/.npm/_logs/2017-06-22T08_18_50_651Z-debug.log.2752372291' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /home/bayo/.npm/_logs/2017-06-22T08_18_50_651Z-debug.log
Ionic info
global packages:
@ionic/cli-utils : 1.4.0
Cordova CLI : 7.0.1
Ionic CLI : 3.4.0
local packages:
@ionic/app-scripts : 1.3.7
@ionic/cli-plugin-cordova : 1.4.0
@ionic/cli-plugin-ionic-angular : 1.3.1
Cordova Platforms : none
Ionic Framework : ionic-angular 3.3.0
System:
Node : v7.9.0
OS : Linux 4.4
Xcode : not installed
ios-deploy : not installed
ios-sim : not installed
npm : 4.2.0
I have tested my connection and all is good.
Kindly help!