yeoman运行grunt serve 提示错误
今天在使用 yeoman 的时候,当我运行 grunt serve 命令的时候,出现如下提示:
1、Error: Cannot find module 'load-grunt-tasks'
$ grunt serve
Loading "Gruntfile.js" tasks...ERROR
>> Error: Cannot find module 'load-grunt-tasks'
Warning: Task "serve" not found. Use --force to continue. Aborted due to warnings.
该错误是因为没有安装 load-grunt-tasks 插件,我们运行如下命令将,所有该项目依赖的所欲node插件,全部安装,命令如下:
# $ sudo npm install #for mac
$ npm install
该命令会将 package.js 中依赖的所有node插件全部安装。
参考文档:http://stackoverflow.com/questions/18114666/grunt-fatal-error-unable-to-find-local-grunt-in-yeoman
2、Warning: Running "compass:server" (compass) task
$ grunt serve
Running "serve" task Running "clean:server" (clean) task
>> 0 paths cleaned. Running "wiredep:app" (wiredep) task Running "wiredep:test" (wiredep) task Running "wiredep:sass" (wiredep) task Running "concurrent:server" (concurrent) task
Warning: Running "compass:server" (compass) task
Warning: Command failed: compass --version
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'compass' (>= 0) among 45 total gem(s) (Gem::LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
from /usr/bin/compass:22:in `<main>'
Use --force to continue. Aborted due to warnings. Execution Time (2015-04-12 05:32:54 UTC)
loading tasks 5ms ▇▇▇ 5%
compass:server 85ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 93%
Total 91ms Use --force to continue. Aborted due to warnings. Execution Time (2015-04-12 05:32:50 UTC)
wiredep:app 134ms ▇▇▇ 4%
concurrent:server 3s ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 95%
Total 3.2s
网上搜了一堆blog,最后发现是未安装 compass ,因为我用 yeoman 构建项目的时候,选了使用 sass ,而在yeoman中使用sass则又需要安装 compass (直接使用sass是不需要的)。
参考文档:http://stackoverflow.com/questions/21865609/grunt-need-compass-installed-in-system-path-warning
compass是基于 ruby 的,因此在安装 compass 前,你先需要确定,你的电脑已经安装了 ruby 。
现在我再来安装 compass:
$ gem install compass
安装好 compass 后,在运行 grunt serve 命令,就会自动打开 http://localhost:9000 。
你就会看到 yeoman 构建工具,创建的默认页面。
yeoman运行grunt serve 提示错误的更多相关文章
- 【Java_基础】cmd下使用java命令运行class文件提示“错误:找不到或无法加载主类“的问题分析
1.问题如下 当在命令行使用java命令执行字节码文件时提示“错误:找不到或无法加载主类” 2. 问题分析 这是由于在运行时类的全名应该是包名+类名,例如在包net.xsoftlab.baike下的类 ...
- 使用java命令运行class文件提示“错误:找不到或无法加载主类“的问题分析
有时候我们需要直接用jdk提供的java命令来执行class文件让软件运行起来,特别是很多初学者,但经常会发现如下提示: 用eclipse或用ant则没有问题. 其实原因很简单,我们忽略了2个细节. ...
- 虚拟器运行iOS8地图提示错误
/SourceCache/ProtocolBuffer_Sim/ProtocolBuffer-225/Runtime/PBRequester.m:799 server (https://gsp13-c ...
- 记一次使用cmd执行java文件遇到的坑...包括“使用java命令运行class文件提示“错误:找不到或无法加载主类“的问题”
今天写了一个java文件,类似聊天软件的东西.在eclipse里输入输出显得没感觉,于是乎就准备在cmd里输入和显示输出.如下图,我准备运行的是ChatDemo.class文件.路径是:D:\work ...
- 解决IIS7运行ASP提示错误:An error occurred on the server when processing the URL. Please contact the system administrator
原文:解决IIS7运行ASP提示错误:An error occurred on the server when processing the URL. Please contact the syste ...
- 今天遇到一件开心事,在eclipse编写的代码在命令窗口中编译后无法运行,提示 “错误: 找不到或无法加载主类”
java中带package和不带package的编译运行方式是不同的. 首先来了解一下package的概念:简单定义为,package是一个为了方便管理组织java文件的目录结构,并防止不同java文 ...
- mac 下 使用 java运行 class 文件 总是提示 “错误: 找不到或无法加载主类”的解决方法
发现问题 切换到mac平台后,突然想写点程序运行在mac下,想到mac自带java,会方便好多.不过在这过程中遇到了麻烦: 总是提示 “错误: 找不到或无法加载主类” 工程结构 查了好久,终于找到原型 ...
- vue中npm run dev运行项目不能自动打开浏览器! 以及 webstorm跑vue项目jshint一直提示错误问题的解决方法!
vue中npm run dev运行项目不能自动打开浏览器!以及 webstorm跑vue项目jshint一直提示错误问题的解决方法! 1.上个项目结束就很久没有使用vue了,最近打算用vue搭建自己的 ...
- nodemon运行 提示错误:无法加载文件 C:\Users\gxf\AppData\Roaming\npm\nodemon.ps1,因为在此系统上禁止运行脚本。
nodemon运行 提示错误:无法加载文件 C:\Users\gxf\AppData\Roaming\npm\nodemon.ps1,因为在此系统上禁止运行脚本. 这是你笔记本禁止运行脚本,解决办法 ...
随机推荐
- ASP.NET Web – 状态管理
状态类型 客户端或服务器资源 有效时间 ViewState 客户端 只在一个页面中 Cookie 客户端 关闭浏览器时会删除临时cookie,永久cookie存储在客户系统的磁盘上 Session 服 ...
- .net datatable 添加一列
dt.Columns.Add("image", Type.GetType("System.String")); foreach (DataRow dr in d ...
- 2208: [Jsoi2010]连通数 - BZOJ
Description Input 输入数据第一行是图顶点的数量,一个正整数N. 接下来N行,每行N个字符.第i行第j列的1表示顶点i到j有边,0则表示无边. Output 输出一行一个整数,表示该图 ...
- python 日期转星期
import time import datetime today = int(time.strftime('%w')) print today anyday = datetime.datetime( ...
- 2013 Asia Chengdu Regional Contest
hdu 4786 Fibonacci Tree http://acm.hdu.edu.cn/showproblem.php?pid=4786 copyright@ts 算法源于ts,用最小生成树可以求 ...
- 在线最优化求解(Online Optimization)之四:RDA
在线最优化求解(Online Optimization)之四:RDA 不论怎样,简单截断.TG.FOBOS都还是建立在SGD的基础之上的,属于梯度下降类型的方法,这类型方法的优点就是精度比较高,并且T ...
- 【Asp.Net MVC-视频】
Asp.Net MVC官网网发布的pluralsight视频教学: http://pluralsight.com/training/Player?author=scott-allen&name ...
- iOS7 兼容及部分细节
1:statusBar字体为白色 在plist里面设置View controller-based status bar appearance 为 NO:设置statusBarStyle 为 UISta ...
- jstl删除session,choose,动态获取request当前工程路径
1.jstl标签c:remove删除session request.getSession().setAttribute("ssmsg", "修改成功"); &l ...
- jstl if条件判断字符串代码
<c:if test="${netWorkInfo.networkType eq '快修店'}"> <input type="radio" n ...