Installing two different versions of the grunt on the same machine

I contribute to two projects that 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 cannot seem like you were messing around with project A, since it discovers the grunt file in different ways. I could port Project A from grunt v0.3-> 0.4, however I feel that there might be a better solution there.

How can I resolve this conflict?

+4
source share
1 answer

Grunt 0.3 is used for global installation, but with 0.4 you install cli globally ( npm install grunt-cli ). This should still work with 0.3 if you are installing cli globally and then version 0.3 locally (e.g. 0.4).

So, we summarize:

  • npm uninstall grunt -g to uninstall the old global version of grunt
  • npm install grunt-cli -g ensure that cli is installed globally
  • npm install grunt@0.3 in your project 0.3
+12
source

Source: https://habr.com/ru/post/1483895/


All Articles