这是我第一次使用yeoman为AngularJS应用程序设置脚手架,我不得不承认我可能是nodeJS,grunt和bower世界的新手。
所以,这就是我到目前为止所做的:
我确定安装了yeoman,grunt-cli和角度发生器包
npm install -g yo grunt-cli bower
npm install -g generator-angular
生成我的应用
yo angular
我也尝试过:
yo angular --min-safe
到目前为止,al似乎很好。在给出的选项之间,我选择了Twitter Bootstrap,没有角度依赖,并覆盖我的本地.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
由于某种原因未定义,而且这个变量来自对grunt.util.spawn
的调用。这是我不知所措的地方。
我错过任何依赖吗?我错过了任何配置吗?
的信息:
答案 0 :(得分:57)
*叹气 *,抱歉。
我只需要写下这个问题然后弄清楚我需要安装Ruby和指南针宝石。现在它是有道理的:编译过程不会产生。
安装Ruby后,运行:
gem install compass
你应该好好去。
编辑:安装Ruby之后,需要确保将ruby运行时文件的路径添加到PATH变量中。 (谢谢JagWire!)
答案 1 :(得分:4)
在Windows上,我安装了一些ruby:
C:\ruby187
和
C:\Ruby200-x64
使用以下方法在两个地方安装指南针:
gem install compass
这解决了我在Windows 8 64位上的问题
答案 2 :(得分:2)
按照与Ember相同的程序,运行grunt。收到错误" TypeError:无法读取属性' stdout'未定义的。"宝石安装指南针(红宝石已经安装在我的Windows 7 64位),即使罗盘应该安装得更早,这是有效的。咕噜咕噜咕噜咕噜地服务没有问题。