NgCordova bower error - any ideas how to fix it?

I tried to make sure that I am using the latest version, since my ngCordova media plugin is not working for any reason.

I get this error:

npm WARN locking Error: EACCES, open '/Users/SubjectiveEffect/.npm/_locks/bower-e8debc5417026b57.lock' npm WARN locking at Error (native) npm WARN locking /Users/SubjectiveEffect/.npm/_locks/bower-e8debc5417026b57.lock failed { [Error: EACCES, open '/Users/SubjectiveEffect/.npm/_locks/bower-e8debc5417026b57.lock'] npm WARN locking errno: -13, npm WARN locking code: 'EACCES', npm WARN locking path: '/Users/SubjectiveEffect/.npm/_locks/bower-e8debc5417026b57.lock' } npm ERR! Darwin 14.5.0 npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "bower" npm ERR! node v0.12.7 npm ERR! npm v2.11.3 npm ERR! Attempt to unlock /usr/local/lib/node_modules/bower, which hasn't been locked npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! <https://github.com/npm/npm/issues> npm ERR! Please include the following file with any support request: npm ERR! /Users/SubjectiveEffect/myApp/npm-debug.log 

I do not know how to fix this.

Any ideas?

Edit: I cleaned, removed, and reinstalled a bit. I get this error when I try to install bower install ngCordova

 "bower cached git://github.com/driftyco/ng-cordova.git#0.1.12-alpha bower validate 0.1.12-alpha against git://github.com/driftyco/ng-cordova.git#* bower ECMDERR Failed to execute "git ls-remote --tags --heads git://github.com/driftyco/ng-cordova.git", exit code of #69 Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo. Additional error details: Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo." 

But if I try to run it using sudo, they told me:

 "bower ESUDO Cannot be run with sudo Additional error details: Since bower is a user command, there is no need to execute it with superuser permissions. If you're having permission errors when using bower without sudo, please spend a few minutes learning more about how your system should work and make any necessary repairs." 

Any ideas?

+5
source share
3 answers

This error indicates problems with obtaining the Xcode / iOS license agreement, which is a dependency of Cordova (for iOS emulation to work).

I assume that Xcode already has npm / bower installed, you just need to open it for the first time (Cmd-Space, then enter Xcode ) to accept the license agreement and then restart bower install ngCordova .

If Xcode is not already installed, it is probably less of a hassle to install it manually (see here for more details), open it once and repeat bower install ngCordova .

BTW, ilj is right, it is usually bad practice to run npm or bower under sudo. This leads to all kinds of worms.

+3
source

bower complains that you are running it as root, which is usually bad practice. you need to run it as "bower --allow-root".

+2
source

I had the same problem with Ionic. The reason is that xCode has been upgraded to a newer version and I have not accepted the conditions or started it after the upgrade.

Just open xCode and try again.

+1
source

All Articles