我想要在我的Node项目中安装Yeoman、Grunt和Bower。
我使用Nodeclipse插件在Eclipse中创建了一个Node项目,并在cmd中导航到项目文件夹(该文件夹位于H:\Eclipse Workspace\YoTest),然后输入以下命令:
npm install yo -g
npm install generator-webapp -g
yo webapp
选择了:Sass(使用Compass),在命令行中输入:
然后输入:
grunt serve
运行Web应用程序时,我收到以下错误信息:Done, without errors.
Warning: Running "compass:server" (compass) task
Warnin: You need to have Ruby and Compass installed and in your system PATH for
this task to work. More info: https://github.com/gruntjs/grunt-contrib-compass
Use --force to continue.
Aborted due to warnings. Use --force to continue.
Aborted due to warnings.
我该如何修复这个问题,以便使用grunt运行我的节点项目?
PS:我不确定这是否与问题有关,但我在package.json的1-27行中还会遇到以下错误:
Multiple markers at this line
- strings must use singlequote
- strings must use singlequote
这是我的 package.json 文件
{
"name": "yotest2",
"version": "0.0.0",
"dependencies": {},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-uglify": "~0.2.0",
"grunt-contrib-compass": "~0.7.0",
"grunt-contrib-jshint": "~0.7.0",
"grunt-contrib-cssmin": "~0.7.0",
"grunt-contrib-connect": "~0.5.0",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-htmlmin": "~0.1.3",
"grunt-bower-install": "~0.7.0",
"grunt-contrib-imagemin": "~0.2.0",
"grunt-contrib-watch": "~0.5.2",
"grunt-rev": "~0.1.0",
"grunt-autoprefixer": "~0.5.0",
"grunt-usemin": "~2.0.0",
"grunt-mocha": "~0.4.0",
"grunt-modernizr": "~0.4.0",
"grunt-newer": "~0.6.0",
"grunt-svgmin": "~0.2.0",
"grunt-concurrent": "~0.4.0",
"load-grunt-tasks": "~0.2.0",
"time-grunt": "~0.2.0",
"jshint-stylish": "~0.1.3"
},
"engines": {
"node": ">=0.8.0"
}
}
我在使用Windows操作系统。
gem update --system && gem install compass
来完成这个。 - Rob SedgwickRuby和Compass已安装并在系统PATH中
。我不得不重新启动IDE以获取更新的环境。 - Vadzim