I wonder if it's possible to run grunt 0.4.* without having installed grunt-cli.
I understand that grunt-cli looks for the version of grunt installed in node-modules in my project directory in order to run that version of grunt but...is it possible to run grunt without having grunt-cli installed? How?
Thanks in advance!
Installing a specific version If you need a specific version of Grunt or a Grunt plugin, run npm install grunt@VERSION --save-dev where VERSION is the version you need. This will install the specified version, adding it to your package. json devDependencies. Note that a tilde version range will be used in your package.
Installing grunt-cli locally If you prefer the idiomatic Node. 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" } .
The grunt-cli is a very small amount of code. If I was you I would look through it in the GitHub repository. That way you will learn what it does, and it's very easy to do the same.
I have had luck with running it with no grunt-cli. You can do it with the following command:
node -e "require('grunt').cli()"
If you want to specify tasks you can do it like this:
node -e "var g = require('grunt'); g.cli.tasks = ['default']; g.cli()"
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