Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

  • I made sure yeoman, grunt-cli and the angular-generator packages are installed

    npm install -g yo grunt-cli bower npm install -g generator-angular 
  • Generated my app

    yo angular 

    I also tried:

    yo angular --min-safe 

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:

  • OS: Windows 8 x64
  • node: v0.10.22
like image 986
Alpha Avatar asked Nov 25 '13 04:11

Alpha


People also ask

Is grunt deprecated?

grunt. util. _ is deprecated and we highly encourage you to npm install lodash and var _ = require('lodash') to use lodash .

What does grunt serve do?

This plugin allows you to avoid switching to the command line. You simply need to replace the script in your html page by the local server that this task creates. Next time you refresh, the browser will call this local server that will run the grunt tasks you defined and will return the generated file.


2 Answers

*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!)

like image 142
Alpha Avatar answered Oct 08 '22 19:10

Alpha


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

like image 31
Cybul Avatar answered Oct 08 '22 21:10

Cybul