requires a peer of grunt@>=0.4.0
Asked Answered
R

1

13

Why do I get the error below? My grunt version is > v0.4.0

npm install grunt-contrib-concat --save-dev

+-- UNMET PEER DEPENDENCY grunt@>=0.4.0

Error messages:

..Projects\Hartz\Hartz>npm install grunt-contrib-concat --save-dev [email protected] C:..\Projects\Hartz\Hartz +-- UNMET PEER DEPENDENCY grunt@>=0.4.0 `-- [email protected]

npm WARN [email protected] requires a peer of grunt@>=0.4.0 but none was installed. npm WARN [email protected] requires a peer of grunt@>=0.4.0 but none was installed. npm WARN [email protected] No repository field.

grunt -V

grunt-cli v1.2.0
grunt v1.0.1

Revenge answered 4/9, 2016 at 8:56 Comment(0)
R
16

Install grunt locally (not globally).

npm install grunt --save-dev

It should help, because grunt-contrib-concat is looking for locally installed grunt module.

Representational answered 4/9, 2016 at 9:11 Comment(7)
And how to tell it, to use the globally installed grunt module?Revenge
This is good question. My understanding is that its not possible by design - npm is built around the idea NOT to have global dependencies repository, but to have local one instead, and every module should require particular and possibly different version of the same module. For example, one of your modules requires [email protected] and another requires [email protected]. So your node_modules directory will have BOTH versions of moduleA but in different versions. Does it make sense?Representational
No, it does not make sense. For example nuget, at least the newer version, installs the packages into a global folder --> different packages with different versions. The benefit is, you don't have packages scattered locally in every solution you create. The solutions then reference the specific version from the global packages folder. For example, your refrence MVC v2.x.x in 5 different solutions: Local approach: you have the same five packages deployed locally. Global approach: one package, referenced by all solutions -> centralized and saves a bit of disk space ;-)Revenge
I get this warning by typing in this answer! eg "npm install grunt --save-dev" gives me "[email protected] requires a peer of grunt@~0.4.1 but none was installed"Yahwistic
I get the same error when running npm install grunt --save-devRaising
i dont think this is the right answer different modules require different versions of gruntAbnormity
This answer did not solve my problem. Should it be noted if bowerjs is used to manage dependencies and what impact that may have?Colossae

© 2022 - 2024 — McMap. All rights reserved.