【问题标题】:Errors occurring when attempting to run grunt serve on Yeoman scaffolding尝试在 Yeoman 脚手架上运行 grunt serve 时发生错误
【发布时间】:2014-12-18 18:37:58
【问题描述】:

我正在尝试在 Yeoman 脚手架上运行 grunt serve,但这种情况一直在发生:

Gizmo:testapp brianwalborn$ grunt connect
>> Local Npm module "grunt-contrib-connect" not found. Is it installed?
Loading "imagemin.js" tasks...ERROR
>> Error: Cannot find module 'imagemin-gifsicle'
>> Local Npm module "grunt-mocha" not found. Is it installed?
Warning: Task "connect" not found. Use --force to continue.

Aborted due to warnings.


Execution Time (2014-10-23 06:07:08 UTC)
loading tasks  859ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 100%
Total 860ms

我看到了很多问题,但没有一个与此错误消息有关。我假设这只是我缺少的东西。有人对可能导致这种情况的原因有任何建议吗?

提前致谢。

【问题讨论】:

  • 您是否运行npm install 来安装依赖项?这些模块是否出现在 node_modules 目录中?

标签: gruntjs yeoman yeoman-generator


【解决方案1】:

您是否使用运行 grunt 任务的同一用户安装了 npm 包?

也许 grunt 正在寻找一个空的 npm cache_folder。

您可以尝试的另一件事是:

  1. 更新到最新的 grunt-contrib-connect 和/或 grunt-contrib-imagemin 版本

  2. 清理npm缓存,命令如下:npm cache clear

  3. 如果您运行的是 Linux,请确保您安装了 build-essential 软件包。 (https://askubuntu.com/questions/398489/how-to-install-build-essential)

【讨论】:

    猜你喜欢
    • 2015-02-12
    • 2016-01-23
    • 2014-08-29
    • 2014-09-08
    • 2015-07-28
    • 2018-06-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多