npm WARN弃用lodash@2.4.2:不再维护lodash @ <3.0.0

Mas*_*nni 20 node.js npm gruntjs lodash grunt-cli

使用npm在全局安装grunt-cli时遇到错误.这与lodash有关:

npm WARN deprecated lodash@2.4.2:
lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^3.0.0.
Run Code Online (Sandbox Code Playgroud)

以下是我正在使用的版本以及安装的全局包列表.

node: v5.1.0

npm: v3.5.0

npm list -g: http ://pastebin.com/NuJU3bY0


我试图在全局安装最新版本的lodash(v3.10.1),但在卸载我的grunt-cli全局包后再次出现错误,然后重新安装我的全局包.以下是安装日志:

sudo npm install lodash -g
/usr/local/lib
??? lodash@3.10.1

sudo npm install grunt-cli -g
npm WARN deprecated lodash@2.4.2: 
lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^3.0.0.

/usr/local/bin/grunt -> /usr/local/lib/node_modules/grunt-cli/bin/grunt
/usr/local/lib
??? grunt-cli@0.1.13
  ??? findup-sync@0.1.3
  ? ??? glob@3.2.11
  ? ? ??? inherits@2.0.1
  ? ? ??? minimatch@0.3.0
  ? ?   ??? lru-cache@2.7.3
  ? ?   ??? sigmund@1.0.1
  ? ??? lodash@2.4.2
  ??? nopt@1.0.10
  ? ??? abbrev@1.0.7
  ??? resolve@0.3.1

npm WARN In grunt-cli@0.1.13 replacing bundled version of nopt with nopt@1.0.10
npm WARN In grunt-cli@0.1.13 replacing bundled version of findup-sync with findup-sync@0.1.3
npm WARN In grunt-cli@0.1.13 replacing bundled version of resolve with resolve@0.3.1
npm WARN In grunt-cli@0.1.13 replacing bundled version of lodash with lodash@2.4.2
npm WARN In grunt-cli@0.1.13 replacing bundled version of glob with glob@3.2.11
npm WARN In grunt-cli@0.1.13 replacing bundled version of inherits with inherits@2.0.1
npm WARN In grunt-cli@0.1.13 replacing bundled version of minimatch with minimatch@0.3.0
npm WARN In grunt-cli@0.1.13 replacing bundled version of sigmund with sigmund@1.0.1
npm WARN In grunt-cli@0.1.13 replacing bundled version of lru-cache with lru-cache@2.7.3
npm WARN In grunt-cli@0.1.13 replacing bundled version of abbrev with abbrev@1.0.7
Run Code Online (Sandbox Code Playgroud)

任何人都可以告诉我我做错了什么,或者如何解决这个错误并获得grunt-cli的干净安装?

Ten*_*n H 19

该软件包grunt-cli依赖于旧版本的lodash.它不应该影响grunt的功能; 这只是一条警告信息.

所以,你没有做错什么,这不是一个错误信息,只是一个警告,你安装grunt-cli的方式应该可以正常工作.

  • 这个答案可能让人安心,但它确实无法解决这个不必要的警告问题 (13认同)