Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing two different versions of grunt on one machine

I'm contributing to two projects that both require different versions of Grunt:

  • Project A requires Grunt v0.3.2
  • Project B requires Grunt v0.4.1

Both projects have separate workspaces.

I currently have Grunt v0.4.1 installed on my machine; however I can't seem to run grunt on Project A since it detects the gruntfile differently. I could migrate Project A from grunt v0.3->0.4, however I feel there could be a better solution out there in the meantime.

How would I go about solving this conflict?

like image 737
Rayan Bouajram Avatar asked Jun 01 '13 01:06

Rayan Bouajram


People also ask

How do I install a specific version of grunt?

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.

Is grunt deprecated?

grunt. util. _ is deprecated and we highly encourage you to npm install lodash and var _ = require('lodash') to use lodash .

Is grunt still used?

The Grunt community is still going strong and both tools look like they're going to be around for a while yet. I should mention that another up and coming alternative to task runners like Grunt and Gulp is simply using npm scripts with command-line tools.


1 Answers

Grunt 0.3 used to require a global install, but with 0.4 you install the cli globally (npm install grunt-cli). This should still work with 0.3 if you install the cli globally, and then the 0.3 version locally (like 0.4 does).

So to summarize:

  • npm uninstall grunt -g to remove the old global grunt version
  • npm install grunt-cli -g ensure the cli is installed globally
  • npm install [email protected] into your your 0.3 project
like image 153
nschonni Avatar answered Sep 24 '22 00:09

nschonni