Installing grunt-cli locally js method to get started with a project ( npm install && npm test ) then install grunt-cli locally with npm install grunt-cli --save-dev . Then add a script to your package. json to run the associated grunt command: "scripts": { "test": "grunt test" } .
Have you made sure to install grunt-cli
globally on your Travis node?
My Travis CI config looks like:
language: node_js
node_js:
- "0.8"
before_install: npm install -g grunt-cli
install: npm install
before_script: grunt build
And my package.json:
{
...
"scripts": {
"test": "grunt test"
},
...
}
I will explain the flow of steps that Travis will execute:
before_install
. My only prerequisite (besides node.js) is grunt-cli
so I use this step to install it.install
step, in my case this will simply install my npm modulesbefore script
is then executed, running grunt build
grunt test
I'd like to note that this is my own opinion on how to configure Travis. I'm certainly not inclining you should use exactly the same approach.
You likely miss in your travis.yml file:
before_script:
- npm install -g grunt-cli
Then "grunt whatever" should execute ok (assuming you do require grunt in your devDependencies in your package.json).
(see http://www.mattgoldspink.co.uk/2013/02/10/using-travis-ci-with-grunt-0-4-x/)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With