1

I'm trying to make my wiredep work, (using grunt-wiredep)

But I am getting the following warning:

Warning: ENOENT: no such file or directory, open 'wrongpath/bower.json' Use --force to continue.

It seems like the task is looking for my bower.json at the wrong place,
grunt-wiredep version: "1.8.0", Gruntfile config (used yeoman generator..) :

    wiredep: {
        app: {
            src: ['<%= yeoman.app %>/index.html'],
            ignorePath: /\.\.\//
        },
        sass: {
            src: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
            ignorePath: /(\.\.\/){1,2}bower_components\//
        }
    },

I followed following post while trying to solve my issue:

Grunt wiredep:app no such file or directory bower.json

tried downgrading to 1.7.0 - didn't work and upgrading to 1.9.0 - didn't work either.

Community
  • 1
  • 1
liron_hazan
  • 1,396
  • 2
  • 19
  • 27
  • Welcome to Stack Overflow. I have fixed some English issues. Note how I have formatted the error with a leading >. – Rohit Gupta Jan 04 '16 at 08:52
  • leading? you mean the highlight?Just found out what was the issue, a task I'd registered to ran before the wiredep executed cwd thus the wiredep looked for the bower.json in the changed directory.. – liron_hazan Jan 04 '16 at 11:49

1 Answers1

0

My case was solved by removing the change working dir (cwd) reference I had on the task which ran before the wiredep task, in order to isolate the issue I recommend to run first the wiredep task and if it works without any warnings/errors, comment out the task which suppose to run before wiredep and if that works well, that's probably an indication that the task you ran before the wiredep uses cd/cwd somewhere (e.g. if it's a task which executes tests, it could be in a certain test code - that was my case).

liron_hazan
  • 1,396
  • 2
  • 19
  • 27