Battle errors

I installed bower, but getting these errors, any idea?

[ noor@laptop03 ~]$ bower /usr/local/lib/node_modules/bower/node_modules/bower-config/lib/util/rc.js:55 throw error; ^ 
+7
bower
source share
1 answer

I had the same issue yesterday. If your complete error log was as follows:

 /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 might have missed some quotes. I had this:

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

Changed and got the job:

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

If you still get another error with Unexpected Tokens, check your bower.json for quotes related to 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" } } 
+18
source share

All Articles