21

I am trying to make my first yeoman app. I followed every step in the below link: http://ponderingdeveloper.com/2013/03/08/preparing-a-windows-machine-to-use-yeoman/

When I execute yo webapp everything goes well.

But when I use the grunt command I am faced with the following error:

    grunt --trace


    Running "jshint:all" (jshint) task
    >> 4 files lint free.

    Running "clean:server" (clean) task
    Cleaning ".tmp"...OK

    Running "concurrent:test" (concurrent) task

    Running "coffee:dist" (coffee) task
        Warning: Errno::ENOENT on line ["33"] of C: No such file or directory - C:/D
    ysk Google/Sublime/Norbert/motocycle/app/bower_components
        Run with --trace to see the full backtrace Use --force to continue.

        Aborted due to warnings.

I looked for bower_components folder - it does not exist. I know I can change directory in the .bowerrc file, but i do not know which directory is right, I cannot find it.

EDIT : Programs versions:

C:\Dysk Google\Sublime\Norbert\motocycle>grunt --version
grunt-cli v0.1.8
grunt v0.4.1

C:\Dysk Google\Sublime\Norbert\motocycle>yo --version
1.0.0-beta.6

C:\Dysk Google\Sublime\Norbert\motocycle>bower --version
0.9.2

C:\Dysk Google\Sublime\Norbert\motocycle>npm view generator-webapp
npm http GET https://registry.npmjs.org/generator-webapp
npm http 200 https://registry.npmjs.org/generator-webapp

{ name: 'generator-webapp',
  description: 'Default Yeoman generator for scaffolding out a front-end web app
',
  'dist-tags': { latest: '0.2.2' },
  versions:
   [ '0.1.0',
     '0.1.1',
     '0.1.2',
     '0.1.3',
     '0.1.4',
     '0.1.5',
     '0.1.6',
     '0.1.7',
     '0.2.0',
     '0.2.1',
     '0.2.2' ],
  maintainers: 'sindresorhus <sindresorhus@gmail.com>',
  time:
   { '0.1.0': '2013-02-14T18:59:31.790Z',
     '0.1.1': '2013-02-14T20:50:59.965Z',
     '0.1.2': '2013-02-15T16:08:42.448Z',
     '0.1.3': '2013-02-15T23:08:13.255Z',
     '0.1.4': '2013-02-16T01:02:02.732Z',
     '0.1.5': '2013-02-25T19:56:03.458Z',
     '0.1.6': '2013-04-08T21:07:10.932Z',
     '0.1.7': '2013-04-10T22:12:39.652Z',
     '0.2.0': '2013-05-13T17:53:11.177Z',
     '0.2.1': '2013-05-13T18:06:06.017Z',
     '0.2.2': '2013-05-13T18:09:12.609Z' },
  author: 'Chrome Developer Relations',
  repository:
   { type: 'git',
     url: 'git://github.com/yeoman/generator-webapp.git' },
  users: { passy: true },
  version: '0.2.2',
  keywords:
   [ 'yeoman-generator',
     'web',
     'app',
     'front-end',
     'h5bp',
     'modernizr' ],
  homepage: 'https://github.com/yeoman/generator-webapp',
  bugs: 'https://github.com/yeoman/generator-webapp/issues',
  main: 'app/index.js',
  scripts: { test: 'mocha --reporter spec' },
  dependencies:
   { 'yeoman-generator': '~0.11.1',
     cheerio: '~0.10.8' },
  peerDependencies: { 'generator-mocha': '~0.1.1' },
  devDependencies: { mocha: '~1.9.0' },
  engines: { node: '>=0.8.0' },
  licenses: { type: 'BSD' },
  readmeFilename: 'readme.md',
  dist:
   { shasum: 'd9f69e7dbf0fd680b30abaf710d47fe38e50fd12',
     tarball: 'http://registry.npmjs.org/generator-webapp/-/generator-webapp-0.2
.2.tgz' },
  directories: {} }
DineshKP
  • 364
  • 2
  • 12
norbert
  • 525
  • 2
  • 6
  • 16
  • Can you post the versions of your programs? grunt --version grunt-cli v0.1.8 grunt v0.4.1 yo --version 1.0.0-beta.5 bower --version 0.9.2 npm view generator-webapp version 0.2.2 – Sheena Artrip May 29 '13 at 16:30
  • I'm having this exact same issue. grunt-cli v0.1.9, grunt v0.4.1, yo - 1.0.0-beta.6, bower -0.9.2, generator-webapp@0.2.2 – Shazboticus S Shazbot May 29 '13 at 17:06
  • Uninstalled everything tried again today and had no problems. Don't know what the difference was. Only thing I did differently was use mysysGit (msysGit-netinstall-1.8.1.2-preview20130201.exe) instead of git-scm. Don't know if that will be useful or not. – Shazboticus S Shazbot May 30 '13 at 17:03
  • I just added the directory `bower_components`under my app folder and it worked? – thomaux May 31 '13 at 09:15
  • @Anzeo When I added directory bower_components under app folder i got problems even faster: Running "jshint:all" (jshint) task >> 4 files lint free. Running "clean:server" (clean) task Cleaning ".tmp"...ERROR Warning: Clean operation failed. Use --force to continue. Aborted due to warnings. – norbert May 31 '13 at 19:03
  • @SheenaArtrip I've edited my post with versions – norbert May 31 '13 at 19:07
  • @ShazboticusSShazbot Did u uninstalled everything from choclatey? – norbert May 31 '13 at 19:09

9 Answers9

12

I just had a similar problem, ran across this post while trying to troubleshoot. I figured it out with a hint I found in a closed GitHub issue for the Yeoman project.

The solution for me was to delete my ~/.bower directory (Mac) and run bower install again in my project's main directory. Once I did that, I found the bower_components directory was where it was supposed to be, and the sample project running as expected. It looks like you're on a Windows machine though, and I'm not sure where that Bower directory is located for you, but if you can find it, give this a try.

Will
  • 151
  • 9
  • 1
    I've tried to make ( on clean folder ): 1. yo webapp, 2. npm uninstall bower ( console told me it wasnt installed ), 3. npm install bower, 4. grunt. Ended like before - Warning: Errno::ENOENT on line ["33"] of C: No such file or directory - C:/D ysk Google/Sublime/Norbert/motocycle/app/bower_components – norbert Jun 02 '13 at 22:17
  • The same happened to me. I'm on Linux Mint though. – imwill Jan 16 '14 at 14:04
  • 1
    Thanks! Also running `bower install` without removing the folder worked :) – Nikos Baxevanis Jan 19 '14 at 16:29
10

It's much simpler than all that. The problem isn't with Bower or Grunt-Karma. The problem happens before that. You need Git to install those components. Up to a certain point Node package manager (npm) handles everything. But certain things need Git.

So, you're using Windows and either you haven't installed Git or you're attempting to run this through the cmd shell. If you have Git installed run Yeoman through the Git Bash or else to set it up to run from the cmd shell also go to:

  • Start Menu > right-click on Computer > Properties
  • On the left, go to Advanced System Settings > Environment Variables

Here under System Variables scroll down and find Path. Click Edit... and enter the path to the Git Bash. It's important to place a semi-colon before the path already there to seperate them. Also you don't need quotes or the actual sh.exe. It should look something like this:

C:\Ruby193\bin;%SystemRoot%\system32;C:\Program Files\nodejs\;C:\Program Files (x86)\Git\bin\

So you can see first we have Ruby, then the system32, then nodejs and finally git. This is just some of what you'll probably see. Don't change anything just add git onto the end.

To test if it worked, from cmd type git and hit enter. If you get back 'git' unrecognised it hasn't worked. If you get back git stuff you're good to go. Yeoman will work fine from now through cmd

isherwood
  • 58,414
  • 16
  • 114
  • 157
Luke Watts
  • 457
  • 5
  • 13
  • I had git and system vars working all the time, so it could have not been the problem : – norbert Aug 07 '13 at 13:44
  • Yeah, my situation was fixed by the above but after reading the git issues for both generator-karma and generator-angular the issue was (in some cases) you needed to run `yo generator-angular && generator-karma` because karma wasn;t being installed with it by default. Updates have fixed this `npm update generator-angular -g` or whatever the generator you where using.... – Luke Watts Aug 21 '13 at 07:43
  • I'm working with Ubuntu and had just put a fresh install and forgot to download git, which was the problem for me. Thanks for that. – Craicerjack Apr 29 '14 at 14:08
4

Ok I made it. It's working only when I do it in this order:

  1. yo backbone
  2. grunt
  3. bower cache clean
  4. delete all project files made by 'yo backbone' command
  5. yo backbone
  6. grunt
  7. grunt server

I know its kinda odd, but I really have to do it like that.

Sergei Basharov
  • 51,276
  • 73
  • 200
  • 335
norbert
  • 525
  • 2
  • 6
  • 16
3

I moved my project to a different directory and experienced this issue. Just needed to move .bowerrc from the old project directory to the new one.

Don't forget your hidden files, kids! They won't move themselves.

nebulous
  • 738
  • 6
  • 17
1

I had this problem when I tried to migrate a project over to windows.

Completely out of order I had to install ruby, git, compass, yeoman, and then remembering to npm install was just out of the question.

After I installed everything, I was getting the error above.

Banging my head against the wall, I deleted the project folder and downloaded it from git again. Starting fresh.

npm install bower install grunt serve It worked.

At the end of the day my problem was that I had tried to run the server before making sure I had all my dependencies fixed.

Don Hogan
  • 611
  • 1
  • 5
  • 7
1

I usually write a startup script for stuff like this for Yeoman apps:

start.sh:

mkdir ~/projectdir/app/bower_components

cd ~/projectdir/app/

sudo apt-get install ruby           &&
sudo gem install sass compass       &&
npm install                         &&
sudo npm install -g grunt-cli       &&
sudo npm install -g bower           &&
grunt
Nikos
  • 7,295
  • 7
  • 52
  • 88
0

i had the same problem , the root cause of my case is that when i build the project stucture using yo angular command, there's the step to choose angular libraries, i chose four of them. but in the process, there's an error happened during the installation of the angular-sanitize 1.2.0.

bower angular-sanitize#~1.2.0        ENOTFOUND Request to https://bower.herokuapp.com/packages/angular-sanitize failed: getaddrinfo ENOTFOUND

so it all works when i uncheck angular sanitize. Hope this will help you!

Aaron Shen
  • 8,124
  • 10
  • 44
  • 86
0

It's looking for bower_components at app/bower_components. If your bower_components directory exists, make sure that your grunt config is looking for the correct path.

Oscar Barrett
  • 3,135
  • 31
  • 36
0

Just had the same issue using the Yeoman Teams Backbone Generator; found here.

The way I fixed it was simple..

yo backbone:appName

bower install

For some reason the bower_components were not being installed by the generator, so running the command manually solved the problem.

Ryan Alexander
  • 569
  • 5
  • 9