Not able to install bower
Opened this issue · 7 comments
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.
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)
maybe try
npm install -g bower
I've tried that command @mattwarren1234 but no results at all.
I'm having the same problem @pallavkul . Have you ever solved it?
Thanks @mattwarren1234, @IvoPereira for me its working but disappointed to see the work is done in the app.
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"
}
}
i removed the "// .bowerrc" at the top and it worked :)
YES having quotations solved the issue! THANK YOU...