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插件全部安装。

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是不需要的)。

compass是基于 ruby 的,因此在安装 compass 前,你先需要确定,你的电脑已经安装了 ruby 。

现在我再来安装 compass:

$ gem install compass

  

安装好 compass 后,在运行 grunt serve 命令,就会自动打开 http://localhost:9000 。

你就会看到 yeoman 构建工具,创建的默认页面。

时间: 2024-08-08 01:25:24

yeoman运行grunt serve 提示错误的相关文章

使用java命令运行class文件提示“错误:找不到或无法加载主类“的问题分析

有时候我们需要直接用jdk提供的java命令来执行class文件让软件运行起来,特别是很多初学者,但经常会发现如下提示: 用eclipse或用ant则没有问题. 其实原因很简单,我们忽略了2个细节. 1.java指令默认在寻找class文件的地址是通过CLASSPATH环境变量中指定的目录中寻找的. 2.我们忽略了package的影响. 第一个问题好解决: 我们直接在CLASSPATH环境变量中加入".;"即可."."的意思是搜索当前目录 第二个问题看下面分析: 看

虚拟器运行iOS8地图提示错误

/SourceCache/ProtocolBuffer_Sim/ProtocolBuffer-225/Runtime/PBRequester.m:799 server (https://gsp13-cn.ls.apple.com/localshift) returned error: 504  Failed to get location shift function: Error Domain=NSURLErrorDomain Code=-1011 "The operation couldn’

在windows直接运行Qt编译出来的可执行程序出现了如下提示错误: this application has requested the runtime to terminate it an unusual way.

在windows直接运行Qt编译出来的可执行程序出现了如下提示错误: this application has requested the runtime to terminate it an unusual way. please contact the application’s support team for more information. 出现这种情况是因为缺少该程序运行所需要的动态链接库. 解决方法一:修改系统环境变量,在Path中添加Qt的bin路径就OK了.不过这只能在本机运

ex14 Python运行提示错误need more than 1 value to unpack

在练习ex14中, 运行提示错误need more than 1 value to unpack 百度搜索的来自知乎的解答https://www.zhihu.com/question/19932406/answer/13391058 才发现再一次,又忘了同时Python ex14.py 的时候应该加上另外一个参数. 代码: ---------------------------- from sys import argv script, user_name = argv prompt = '>

解决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 system administrator 在WINDOWS7或SERVER2008上安装了IIS7,调试ASP程序时出现以下错误: An error occurred on the server when processing the URL. Please contact the system admini

mac 下 使用 java运行 class 文件 总是提示 “错误: 找不到或无法加载主类”的解决方法

发现问题 切换到mac平台后,突然想写点程序运行在mac下,想到mac自带java,会方便好多.不过在这过程中遇到了麻烦: 总是提示 “错误: 找不到或无法加载主类” 工程结构 查了好久,终于找到原型所在,发现网上很多资料都写的都不太多,自己记录一下.先看看工程的位置和目录. 我的eclipse 工作空间位置是: /Users/zhangyunfei/workspace_java 我的工程名字叫:hellodemo 我的main class 的package name (包名)为: hellod

hive运行query语句时提示错误:org.apache.hadoop.ipc.RemoteException: java.io.IOException: java.io.IOException:

hive> select product_id, track_time from trackinfo limit 5; Total MapReduce jobs = 1 Launching Job 1 out of 1 Number of reduce tasks is set to 0 since there's no reduce operator org.apache.hadoop.ipc.RemoteException: java.io.IOException: java.io.IOEx

springboot项目上有个红叉,且ecplise没有自动编译项目,运行提示“错误: 找不到或无法加载主类”

近期在做springboot项目,发现springboot项目上有个红叉但找不到哪个类报错,ecplise没有把项目自动编译,运行还提示"错误: 找不到或无法加载主类",进入工作空间"项目\target\classes",发现项目java类根本没有编译,尝试各种方式发现均不可以,后来在网上发下这篇文章试了确实可以http://blog.csdn.net/u011526234/article/details/50394951,现在remark以下,希望也可以帮到其他遇

grunt serve Warning: Running &quot;sass:server&quot; (sass) task

使用grunt serve运行时遇到一问题: [email protected]:ydkt$ grunt serve Running "serve" task Running "clean:server" (clean) task Cleaning .tmp...OK Running "env:all" (env) task Running "injector:sass" (injector) task Missing opt