Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to install bower #6

Open
rajeshwerkushwaha opened this issue Jun 4, 2014 · 7 comments
Open

Not able to install bower #6

rajeshwerkushwaha opened this issue Jun 4, 2014 · 7 comments

Comments

@rajeshwerkushwaha
Copy link

I have pre installed bower using: $npm install bower
now when I used $bower install its not working. Showing error that 'command not found'. Why?
Due to this index page is not working properly.

@pallavkul-zz
Copy link

I also face the similar issue when I tried bower install command through my terminal. Here is exception I get.
/usr/local/lib/node_modules/bower/node_modules/bower-config/lib/util/rc.js:55
throw error;
^
Error: Unable to parse /Users/labuser/Desktop/spayo/.bowerrc: Unexpected token /
at parse (/usr/local/lib/node_modules/bower/node_modules/bower-config/lib/util/rc.js:48:21)
at json (/usr/local/lib/node_modules/bower/node_modules/bower-config/lib/util/rc.js:70:12)
at rc (/usr/local/lib/node_modules/bower/node_modules/bower-config/lib/util/rc.js:31:9)
at Config.load (/usr/local/lib/node_modules/bower/node_modules/bower-config/lib/Config.js:13:20)
at Function.Config.read (/usr/local/lib/node_modules/bower/node_modules/bower-config/lib/Config.js:48:19)
at Object. (/usr/local/lib/node_modules/bower/lib/config.js:3:38)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)

@mattwarren1234
Copy link

maybe try
npm install -g bower

@IvoPereira
Copy link

I've tried that command @mattwarren1234 but no results at all.

I'm having the same problem @pallavkul . Have you ever solved it?

@rajeshwerkushwaha
Copy link
Author

Thanks @mattwarren1234, @IvoPereira for me its working but disappointed to see the work is done in the app.

@IvoPereira
Copy link

Nice to know that is working @rajeshwerkushwaha :)

@pallavkul I found the solution btw:

If your full error log was this one:

/usr/local/lib/node_modules/bower/node_modules/bower-config/lib/util/rc.js:55
    throw error;
          ^
Error: Unable to parse /vagrant/web/.bowerrc: Unexpected token d
at parse (/usr/local/lib/node_modules/bower/node_modules/bower-config/lib/util/rc.js:48:21)
at json (/usr/local/lib/node_modules/bower/node_modules/bower-config/lib/util/rc.js:70:12)
at rc (/usr/local/lib/node_modules/bower/node_modules/bower-config/lib/util/rc.js:31:9)
at Config.load (/usr/local/lib/node_modules/bower/node_modules/bower-config/lib/Config.js:14:20)
at Function.Config.read (/usr/local/lib/node_modules/bower/node_modules/bower-config/lib/Config.js:49:19)
at Object.<anonymous> (/usr/local/lib/node_modules/bower/lib/config.js:3:38)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)

Then your .bowerrc possibly missed some quotes. I had this:

{
    directory: "app/Resources/public/vendor"
}

Changed to this and got it working:

{
    "directory": "app/Resources/public/vendor"
}

If you still get another error with Unexpected tokens, check your bower.json for quotes surrounding keys and values.

An example of a valid bower.json:

{
  "name": "project",
  "version": "0.0.0",
    "license": "MIT",
    "private": true,
    "ignore": [
          "**/.*",
          "node_modules",
          "bower_components",
          "test",
          "tests"
      ],
    "dependencies": {
          "jquery": "~2.0.3",
          "underscore": "~1.5.2"
      }
  }

@fa8ster
Copy link

fa8ster commented Sep 21, 2014

i removed the "// .bowerrc" at the top and it worked :)

@shaddyhm
Copy link

YES having quotations solved the issue! THANK YOU...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants