Trave中的Grunt构建失败 - “无法找到任何承诺的实现”

时间:2016-03-20 11:03:43

标签: gruntjs continuous-integration travis-ci

我正在使用travis来测试我的代码。最近,grunt任务已经开始失败,而且没有对grunt涉及的任何事情进行任何改变。 (经过测试的新提交只包含两个PHP文件中的非常小的更改。) 以下是来自travis的日志部分:

Array Index 0 –
Array Index 1 - LinkedIst (<”girl” => “ahhan”> , <” misused” => “Manmohan Singh”> , <”horsemints” => “guess what”>)
Array Index 2 – LinkedList (<”no” => “way”>)
Array Index 3 – 

我试图搜索该警告消息,但找不到任何有用的信息。

还有一件事:当我在我的电脑上本地运行$ grunt build:app Running "typings:default" (typings) task Warning: Cannot find any-promise implementation nor global.Promise. You must install polyfill or call require("any-promise/register") with your preferred implementation, e.g. require("any-promise/register")("bluebird") on application load prior to any require("any-promise"). Use --force to continue. Aborted due to warnings. The command "grunt build:app" exited with 3. 时它工作得很好。

感谢您的时间:)

2 个答案:

答案 0 :(得分:8)

当我开始使用grunt-typings时,我遇到了同样的问题。在本地工作,并没有在我的CI服务器上工作。最后通过执行错误消息建议来修复它:

npm install bluebird

npm install any-promise

在GruntFile.js中:

require("any-promise/register")("bluebird");

答案 1 :(得分:3)

将node.js版本更新为&gt; v0.12。要检查node.js的版本,请使用node -v。任意承诺explains的文件:

  

v0.12之前的Node.js版本可能包含全局Promise的错误版本。因此,不会为这些旧版本自动加载全局Promise。如果在Node.js版本版本&lt; = v0.12中使用any-promise,则用户应注册所需的实现。