Node.js Yeoman代表Angular,然后是“;“咕噜咕噜”;韩元';开始

Node.js Yeoman代表Angular,然后是“;“咕噜咕噜”;韩元';开始,node.js,angularjs,gruntjs,yeoman,Node.js,Angularjs,Gruntjs,Yeoman,这是我第一次使用yeoman为AngularJS应用程序设置脚手架,我必须承认我可能是nodeJS、grunt和bower世界的新手 以下是我到目前为止所做的: 我确保安装了yeoman、grunt cli和angular generator软件包 npm install -g yo grunt-cli bower npm install -g generator-angular 生成我的应用程序 yo angular 我还尝试: yo angular --min-safe 到目前

这是我第一次使用yeoman为AngularJS应用程序设置脚手架,我必须承认我可能是nodeJS、grunt和bower世界的新手

以下是我到目前为止所做的:

  • 我确保安装了yeoman、grunt cli和angular generator软件包

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

    yo angular
    
    我还尝试:

    yo angular --min-safe
    
到目前为止,艾尔看起来不错。在给出的选项中,我选择了TwitterBootstrap选项,没有角度依赖项,并覆盖我的本地.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 ...
查看compass编译方法中出现的代码,我发现如下所示:

child.stdout.pipe(process.stdout);
这使我认为由于某种原因,
child
是未定义的,这个变量来自对
grunt.util.spawn
的调用。这就是我不知所措的地方

我缺少依赖吗?我是否缺少任何配置

信息:

  • 操作系统:Windows 8 x64
  • 节点:v0.10.22
    • *叹气*,对不起

      我所做的就是写下这个问题,然后找出我需要安装Ruby和compass gem。现在它有了意义:编译过程不会产生

      安装Ruby后,运行:

      gem install compass
      
      你应该可以走了


      编辑:安装Ruby后,需要确保将Ruby运行时文件的路径添加到path变量中。(谢谢JagWire!)

      在windows上,我安装了一些ruby:

          C:\ruby187
      

      使用以下方法在两个位置安装指南针:

          gem install compass
      

      这解决了我在64位windows 8上的问题,方法与运行grunt的Ember相同。收到错误“TypeError:无法读取undefined的属性'stdout'。gem是否安装了compass(ruby已安装在我的windows 7 64位上),即使compass本应在更早的时候安装,并且该操作正常。运行grunt和grunt没有问题。

      我还想说,您需要将ruby安装的bin文件夹路径附加到全局路径环境变量中。是否只有我,或者有人想知道为什么我需要安装ruby来使用yeoman来建立angular或ember项目吗?@傻瓜4天哪,这是因为指南针是用ruby写的。如果一切都和nodejs一起运行就好了。我只希望有一个更有用的错误消息@ScottCornwell是的,我想是这样的。这看起来很奇怪-正如您所说,错误消息肯定会带来改进。:-)@JossefHarush最初的问题是关于Windows环境的,它只是关于下载和执行一个安装程序——你认为指定如何安装ruby有用吗,因为有几种方法可以实现?我很高兴你在问题中给出了错误的全文。在我巧妙地决定打破我的ruby配置后,为我省去了不少麻烦。
          gem install compass