Node.js npm错误!执行npm ls-g时无关--深度=0
当我使用npmls-g--depth=0列出顶级npm包时,我得到以下输出。只有在安装软件包Node.js npm错误!执行npm ls-g时无关--深度=0,node.js,npm,Node.js,Npm,当我使用npmls-g--depth=0列出顶级npm包时,我得到以下输出。只有在安装软件包learnyounode后,才会发生这种情况 $ npm ls -g --depth=0 /home/animesh/.npm-global/lib ├── aurelia-cli@0.29.0 ├── express@4.15.2 ├── gulp@3.9.1 ├── jasmine@2.6.0 ├── karma@1.7.0 ├── learnyounode@3.5.10 ├── mocha@3.3.
learnyounode
后,才会发生这种情况
$ npm ls -g --depth=0
/home/animesh/.npm-global/lib
├── aurelia-cli@0.29.0
├── express@4.15.2
├── gulp@3.9.1
├── jasmine@2.6.0
├── karma@1.7.0
├── learnyounode@3.5.10
├── mocha@3.3.0
├── npm@4.6.1
└── yo@1.8.5
npm ERR! extraneous: csv-stringify@1.0.4 /home/animesh/.npm-global/lib/node_modules/learnyounode/node_modules/i18n-core/node_modules/csv-stringify
npm ERR! extraneous: eslint@3.14.0 /home/animesh/.npm-global/lib/node_modules/learnyounode/node_modules/i18n-core/node_modules/eslint
npm ERR! extraneous: eslint-config-standard@6.2.1 /home/animesh/.npm-global/lib/node_modules/learnyounode/node_modules/i18n-core/node_modules/eslint-config-standard
npm ERR! extraneous: eslint-plugin-promise@3.4.0 /home/animesh/.npm-global/lib/node_modules/learnyounode/node_modules/i18n-core/node_modules/eslint-plugin-promise
npm ERR! extraneous: eslint-plugin-standard@2.0.1 /home/animesh/.npm-global/lib/node_modules/learnyounode/node_modules/i18n-core/node_modules/eslint-plugin-standard
npm ERR! extraneous: if-env@1.0.0 /home/animesh/.npm-global/lib/node_modules/learnyounode/node_modules/i18n-core/node_modules/if-env
npm ERR! extraneous: mockery@2.0.0 /home/animesh/.npm-global/lib/node_modules/learnyounode/node_modules/i18n-core/node_modules/mockery
npm ERR! extraneous: mustache@2.3.0 /home/animesh/.npm-global/lib/node_modules/learnyounode/node_modules/i18n-core/node_modules/mustache
npm ERR! extraneous: sprintf@0.1.5 /home/animesh/.npm-global/lib/node_modules/learnyounode/node_modules/i18n-core/node_modules/sprintf
npm ERR! extraneous: tap@9.0.3 /home/animesh/.npm-global/lib/node_modules/learnyounode/node_modules/i18n-core/node_modules/tap
我的npm前缀、节点和npm版本
/home/animesh/.npm-global
v6.10.3
4.6.1
有关于如何解决此问题的建议吗?它可能与节点试图列出全局包的问题有关?我以前遇到过这个问题,如果您遵循以下思路: 我接着说: 删除所有全局包(当然,npm本身除外) 手动删除全局节点_modules文件夹下的全局包目录;对我来说,这是/usr/local/lib/node_模块 npm缓存清理 安装所有全球软件包;ie运行与第一步相同的命令,但s/remove/install除外
希望这有帮助 升级到npm@5.0.0已修复此问题。谢谢您的参考。不幸的是,这没有帮助。升级到npm 5后,此问题消失。