ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

bug: Failed to find the bower component

Open vaibhav5923 opened this issue 11 years ago • 57 comments

Type: bug

Platform: all

I am trying to add push notification in my ionic project. When I try to add ionic dependencies I am getting an error as below

Failed to find the bower component "ionic-platform-web-client". Are you sure it exists? (CLI v1.6.5)

Your system information:

Cordova CLI: 5.2.0 Gulp version: CLI version 3.9.0 Gulp local:
Ionic Version: 1.1.0 Ionic CLI Version: 1.6.5 Ionic App Lib Version: 0.3.9 OS: Distributor ID: CentOS Description: CentOS release 5.3 (Final) Node Version: v0.12.7

I also have updated IONIC CLI to 1.6.5

Kindly help me with this issue.

vaibhav5923 avatar Oct 05 '15 06:10 vaibhav5923

I've the same error. No solution works for me.

The commando "bower install --save-dev ionic-platform-web-client" gives me the following:

bower ionic#1.1.0 not-cached git://github.com/driftyco/ionic-bower.git#1.1.0 bower ionic#1.1.0 resolve git://github.com/driftyco/ionic-bower.git#1.1.0 bower ionic#1.1.0 download https://github.com/driftyco/ionic-bower/archive/v1.1.0.tar.gz bower ionic#1.1.0 extract archive.tar.gz bower ionic#1.1.0 invalid-meta ionic is missing "ignore" entry in bower.json bower ionic#1.1.0 resolved git://github.com/driftyco/ionic-bower.git#1.1.0 bower ENOTFOUND Package ionic-platform-web-clien not found

alcesar avatar Nov 03 '15 16:11 alcesar

###Same error here. But I think I know what's the issue and solution. I re-init bower, installed ionic-platform-web-client but still same error message. It seems like there is a problem with ionic add clitask. (/lib/ionic/add.js) at line 17 when its trying to install bower component. it require sudo access with --allow-root option as follows: ** var bowerInstallCommand = 'sudo bower install --save-dev --allow-root ' + componentName; **

bhochhi avatar Nov 04 '15 13:11 bhochhi

should I create a pull request if this is appropriate way to fix this issue?

bhochhi avatar Nov 04 '15 13:11 bhochhi

can you show your bower.json file? here's what I have:

{
  "name": "AppName Here",
  "private": "true",
  "devDependencies": {
    "ionic": "driftyco/ionic-bower#master",
    "ionic-service-core": "~0.1.7",
    "ionic-service-push": "~0.1.8",
    "ngCordova": "~0.1.17-alpha",
    "platform": "~1.3.0",
    "ionic-platform-web-client": "~0.2.1"
  }
}

this error occured to me when I already have the ionic-platform-web-client in the file. all i did is to update it to the latest version and do a bower update

jcuervo avatar Nov 04 '15 13:11 jcuervo

@jcuervo , I think issue is not about bower.json, the add command suppose to be adding all dependencies into your bower.json. All I found was add task needed admin privilege, that's it. If you are on unbuntu, try what i did if that fix the issue.

bhochhi avatar Nov 04 '15 15:11 bhochhi

ah! sorry, mate! i'm on Mac and got my issue resolved already. better tag the owners if your solution resolves this ticket.

jcuervo avatar Nov 04 '15 15:11 jcuervo

I had the same problem on linux, the solution was.

su -c 'npm install -g bower'

eislasq avatar Nov 10 '15 23:11 eislasq

For me sudo npm install -g bower fixed it.

Loubot avatar Nov 12 '15 22:11 Loubot

Luobot...that worked!!! Thanks!

pmramos avatar Nov 21 '15 08:11 pmramos

Just a note for anyone else with this error message: if you're using a network that has certain connections blocked, you may also see this error. My primary work network blocks access to Github, which threw this exact error. After moving to a more open connection, it's all good.

hanamj avatar Dec 09 '15 15:12 hanamj

After i update bower this issue solved npm install -g bower

rahulgit avatar Dec 10 '15 07:12 rahulgit

@hongyongwhy solved with his method and starting cmd as admin: 1.Remove bower.json from the project folder 2.bower install ionic-platform-web-client 3.ionic add ionic-platform-web-client

Kojee avatar Dec 18 '15 19:12 Kojee

I had the same error message, for me the cause was simply that I didn't have bower installed. After installing bower ("npm install -g bower") it worked fine.

leob avatar Dec 21 '15 04:12 leob

I had to install git. Closed and opened windows command prompt and tried this again :

ionic add ionic-platform-web-client

It worked.

niknbr avatar Jan 17 '16 08:01 niknbr

The answer provided by @hanamj resolved my issue. As soon as I read through it I had the 'ah ha' moment and remembered that the network here at the office doesn't play nice with Github.

jasonhodges avatar Jan 21 '16 13:01 jasonhodges

Yes Git was the answer. thanks.

soul3510 avatar Jan 28 '16 11:01 soul3510

I couldn't solve it yet.

igordeoliveirasa avatar Mar 04 '16 13:03 igordeoliveirasa

I could solve it just removing old one commited at: www/lib/ionic-platform-web-client and after calling: ionic add ionic-platform-web-client

igordeoliveirasa avatar Mar 04 '16 13:03 igordeoliveirasa

I have it working for one Ionic Project but not the next - I tried many of the comments here. removing bower.json and bower init npm install -g bower set PATH=%PATH%;C:\Program Files\Git\bin

Nothing seems to work ... help...

2moco avatar Mar 05 '16 01:03 2moco

Well I "solved" it by not using the web client library at all. I found out that:

  • it interferes with proper operation of Firebase in my app (as soon as I include the web client library I get dropped/failing Firebase connections)
  • Surprisingly, I found out that I don't really need the web client lib, at least I was able to use Ionic Push without the library (to send push messages you use a simple REST call via Angular $http)

leob avatar Mar 05 '16 01:03 leob