问题描述
执行
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