Yeoman for Angular,那么“grunt serve”就不会启动

这是我第一次使用yeoman来设置AngularJS应用程序的脚手架,我不得不承认,我很可能是nodeJS,grunt和bower世界的新手。

所以,这是我迄今为止所做的:

  • 我确定yeoman,grunt-cli和angular发生器包被安装

    npm install -g yo grunt-cli bower npm install -g generator-angular 
  • 生成我的应用程序

     yo angular 

    我也试过:

     yo angular --min-safe 

到目前为止,al看起来不错。 在给出的选项之间,我select了Twitter Bootstrap之一,没有angular度依赖关系,并覆盖我的本地.gitignore文件。

毕竟,我尝试运行我的应用程序:

 grunt serve 

在这一点上,grunt抱怨说它没有在本地安装到项目中,所以我运行:

 npm install grunt --save-dev 

再次尝试运行该应用程序:

 grunt serve 

这是我被阻止的地方:

 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 ... 

看看罗盘编译方法中的代码,我发现如下:

 child.stdout.pipe(process.stdout); 

这让我觉得child是由于某种原因未定义的,而这个variables来自grunt.util.spawn 。 这是我在亏本的地方。

我是否缺less任何依赖? 我是否缺less任何configuration?

信息:

  • 操作系统:Windows 8 x64
  • 节点:v0.10.22

*叹了口气 ,对不起。

我所要做的只是编写这个问题,然后找出我需要安装Ruby和指南针的gem。 现在它是有道理的:编译过程不会产生。

安装Ruby之后,运行:

 gem install compass 

你应该很好走。

编辑:安装Ruby后,您需要确保ruby运行时文件的path被添加到您的PATHvariables。 (感谢JagWire!)

在窗户上,我有几个ruby的instalations:

  C:\ruby187 

  C:\Ruby200-x64 

在两个地方安装指南针,使用:

  gem install compass 

这解决了我的问题在Windows 8 64位

按照Ember的相同程序,运行grunt。 收到错误“TypeError:无法读取未定义的属性”stdout“。 即使指南针本来应该安装的更早,这个工作,gem安装指南针(ruby已经安装在我的Windows 7 64位)。 Ran咕噜和咕噜服务没有问题。