requires a peer of grunt@>=0.4.0

2020-08-10 08:23发布

问题:

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 Hartz@1.0.0 C:..\Projects\Hartz\Hartz +-- UNMET PEER DEPENDENCY grunt@>=0.4.0 `-- grunt-contrib-concat@1.0.1

npm WARN grunt-contrib-jshint@1.0.0 requires a peer of grunt@>=0.4.0 but none was installed. npm WARN grunt-contrib-concat@1.0.1 requires a peer of grunt@>=0.4.0 but none was installed. npm WARN Hartz@1.0.0 No repository field.

grunt -V

grunt-cli v1.2.0
grunt v1.0.1

回答1:

Install grunt locally (not globally).

npm install grunt --save-dev

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