0

I'm learning how to use Bower. In an effort to get started, I've created a basic bower.json file whose responsibilty is to get jquery. My bower.json file looks like this:

{
    "name":  "MyProject",
    "version": "0.0.1",
    "devDependencies": {
        "jquery": "~2.1.0"
    }
}

When I run bower install from the directory where my bower.json file is located, I get the following error:

bower                       EMALFORMED Failed to read C:\Projects\MyProject\bower.json

What am I doing wrong? I keep looking for something to be syntactically incorrect. However, everything looks correct to me. Thank you so much for your help!

user3284007
  • 1,697
  • 7
  • 27
  • 43

2 Answers2

5

Since you are on windows, it's quite likely you are having issue with a BOM and/or another utf8/utf16 encoding issue.

Take a look here

Try again with a text editor that doesn't do stupid things (maybe Sublime Text - I'm not too sure what's good on windows).

Community
  • 1
  • 1
Mangled Deutz
  • 11,384
  • 6
  • 39
  • 35
1

Seems like unsolved bug

see link: https://github.com/bower/bower/issues/783

Try using this

{
    "name":  "MyProject",
    "version": "0.0.1",
    "dependencies": {
        "jquery": "~2.1.0"
    }
}

if this didn't work try updating your bower using npm update -g bower

Vamsi
  • 9,510
  • 6
  • 38
  • 46
  • Strange. I copied your JSON above, ran bower install, and I'm still getting the same error. I also tried running bower install after running npm update -g bower. No luck. – user3284007 Mar 22 '14 at 14:26
  • Working fine in our project, never had any problem. – Vamsi Mar 22 '14 at 14:34