Grunt build fails in travis - "Unable to find implementation of any promises"

I use travis to test my code. Recently, grunting tasks began to fail without any grunting changes. (The new testing tested contains only minor changes in the two PHP files). Here is part of the log from travis:

$ 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, eg 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. 

I tried to find this warning, but did not find anything useful.

One more thing: when I run grunt build:app locally on my computer, it works fine.

Thank you for your time:)

+7
continuous-integration gruntjs travis-ci
source share
2 answers

I had the same problem when I started using grunt traits. Worked locally and did not work on my CI server. The fix ended by doing what the error message suggests:

npm install bluebird

npm install any-promise

In GruntFile.js:

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

+8
source share

Update the version of node.js> v0.12. To check the version of node.js, use node -v . The documentation for any promise explains :

Node.js versions prior to v0.12 may contain buggy versions of the global promise. For this reason, the global Promise does not load automatically for these older versions. When using any promises in version versions of node.js <= v0.12, the user must register the desired implementation.

+3
source share

All Articles