【问题标题】:Travis CI and Grunt Error: Grunt build failed and exited with 99 during '.'Travis CI 和 Grunt 错误:Grunt 构建失败并在“。”期间以 99 退出
【发布时间】:2017-04-22 17:21:58
【问题描述】:

我正在尝试将 Travis CI 与存储库(在 github 上分叉)集成。一切都很好,但 Travis CI 网站在 Job 下显示以下错误。

Fatal error: Unable to find local grunt.
The command "grunt build" failed and exited with 99 during .

我在我的.travis.yml 中添加了 npm install 并且还在我的package.json 文件中定义了脚本。 grunt 依赖项和 gruntfile.js 也已正确设置。

【问题讨论】:

  • grunt 是什么版本的?你能用你的.travis.ymlpackage.json 中的脚本编辑吗?

标签: node.js git gruntjs travis-ci


【解决方案1】:
Unable to find local grunt.

非常明确。只需将 grunt 添加到 package.json 的依赖项或运行

npm i --save grunt

编辑:OP的问题实际上是由于项目根目录下缺少package.json

【讨论】:

  • Grunt 已经在我的 package.json 的依赖项中:` "devDependencies": { "grunt": "^0.4.5", "grunt-concurrent": "~0.4.3", “grunt-contrib-jshint”:“~0.10.0”,“grunt-contrib-watch”:“~0.5.3”,“grunt-nodemon”:“~0.2.0”},`我还添加了npm安装在我的 .travis.yml 文件中:before_install: npm install -g grunt-cli install: npm install before_script: grunt build script: grunt travis 谢谢,Apurva Nagar
  • 它在devDependencies 中。也将其添加到普通的dependencies
  • 我在npm install 期间也看到以下错误:npm WARN enoent ENOENT: no such file or directory, open '/home/travis/build/Apurva-Nagar/Tracker/package.json' npm WARN Tracker No description npm WARN Tracker No repository field. npm WARN Tracker No README data npm WARN Tracker No license field. 但我真的不知道如何解决这个问题,有什么想法吗?
  • 这只是意味着您的package.json 找不到。它是您项目的根源吗?如果我去你的GitHub project page,我看到没有。您需要在项目的根目录下添加package.json
  • 新的错误,真不知道哪里出了问题。查看错误 --> errors
猜你喜欢
  • 1970-01-01
  • 2018-08-31
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-06-08
  • 1970-01-01
相关资源
最近更新 更多