Alpha
Alpha

Reputation: 7858

Yeoman for Angular, then "grunt serve" won't start

This is the first time I use yeoman to setup the scaffolding for an AngularJS app, and I have to admit I am likely new to the nodeJS, grunt and bower world.

So, here's what I've done so far:

So far, al seems good. Between the options given, I choose the Twitter Bootstrap one, no angular dependencies, and to overwrite my local .gitignore file.

After all that, I try to run my app:

grunt serve

At this point, grunt complains that it is not locally installed into the project, so I run:

npm install grunt --save-dev

No again, trying to run the app:

grunt serve

And this is where I get blocked:

C:\Projects\what-now>grunt serve
Running "serve" task

Running "clean:server" (clean) task

Running "concurrent:server" (concurrent) task

Running "copy:styles" (copy) task

Done, without errors.
    Warning:
    C:\Projects\what-now\node_modules\grunt-contrib-compass\node_modules\tmp\lib\tmp.js:261
      throw err;
            ^
    TypeError: Cannot read property 'stdout' of undefined
        at compile (C:\Projects\what-now\node_modules\grunt-contrib-compass\tasks\compass.js:37:10)
        at C:\Projects\what-now\node_modules\grunt-contrib-compass\tasks\compass.js:68:7
        at C:\Projects\what-now\node_modules\grunt-contrib-compass\tasks\lib\compass.js:121:11
        at _fileCreated (C:\Projects\what-now\node_modules\grunt-contrib-compass\node_modules\tmp\lib\tmp.js:172:7)
        at C:\Projects\what-now\node_modules\grunt-google-cdn\node_modules\bower\node_modules\rimraf\node_modules\graceful-fs\graceful-fs.js:53:5
        at C:\Projects\what-now\node_modules\grunt-google-cdn\node_modules\bower\node_modules\rimraf\node_modules\graceful-fs\graceful-fs.js:62:5
        at OpenReq.Req.done (C:\Projects\what-now\node_modules\grunt-google-cdn\node_modules\bower\node_modules\fstream\node_modules\graceful-fs\graceful-fs.js:142:5)
        at OpenReq.done (C:\Projects\what-now\node_modules\grunt-google-cdn\node_modules\bower\node_modules\fstream\node_modules\graceful-fs\graceful-fs.js:64:22)
        //... stack trace continues ...

Looking at the code that blows up in compass' compile method, what I find is the following:

child.stdout.pipe(process.stdout);

This makes me think that child is undefined for some reason, and this variable comes from a call to grunt.util.spawn. This is where I am at a loss.

Am I missing any dependency? Am I missing any configuration?

Info:

Upvotes: 33

Views: 18688

Answers (3)

umbregachoong
umbregachoong

Reputation: 349

Following the same procedure for Ember, running grunt. Received the error "TypeError: Cannot read property 'stdout' of undefined." Did gem install compass (ruby had already been installed on my windows 7 64 bit) even though compass was supposed to be installed earlier and this worked. Ran grunt and grunt serve with no problems.

Upvotes: 2

Alpha
Alpha

Reputation: 7858

*sighs*, sorry.

All it took me is to write this question to then figure out I needed to have installed Ruby and the compass gem. Now it makes sense: the process for compiling would not spawn up.

After installing Ruby, run:

gem install compass

And you should be good to go.

EDIT: After you install Ruby, you need to make sure that the ruby runtime files' path is added to your PATH variable. (Thanks JagWire!)

Upvotes: 57

Cybul
Cybul

Reputation: 71

On windows i had a few instalations of ruby:

    C:\ruby187

and

    C:\Ruby200-x64

install compass in both places, using:

    gem install compass

this resolve my issue on windows 8 64bit

Upvotes: 4

Related Questions