npm ERR! extraneous


问题描述

执行npm list -g的时候, 提示npm ERR! extraneous 错误

$ npm list -g
...
npm ERR! extraneous: ws@1.1.4 /usr/lib/node_modules/weex-toolkit/node_modules/ws
npm ERR! extraneous: xtend@4.0.1 /usr/lib/node_modules/weex-toolkit/node_modules/xtend
npm ERR! extraneous: xtoolkit@0.2.7 /usr/lib/node_modules/weex-toolkit/node_modules/xtoolkit
npm ERR! extraneous: y18n@3.2.1 /usr/lib/node_modules/weex-toolkit/node_modules/y18n
npm ERR! extraneous: yallist@2.1.2 /usr/lib/node_modules/weex-toolkit/node_modules/yallist
npm ERR! extraneous: yargs@6.6.0 /usr/lib/node_modules/weex-toolkit/node_modules/yargs
npm ERR! extraneous: yargs-parser@4.2.1 /usr/lib/node_modules/weex-toolkit/node_modules/yargs-parser

解决方法

更新npm即可

$ npm i -g npm@latest                                                     1 ↵
[    ..............] - loadRequestedDeps: sill install loadAllDepsIntoIdealTree
...

$ npm -g --depth=0 list                                                   1 ↵
/usr/lib
├── cnpm@4.5.0
├── npm@5.3.0
├── pyvm@1.0.0
├── weex-toolkit@1.0.5
└── wt-cli@6.1.0

参考文档


Author: Itaken
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint polocy. If reproduced, please indicate source Itaken !
  TOC目录