gpt4 book ai didi

node.js - npm peerDependency 问题与 grunt 和 flatiron peer

转载 作者:IT老高 更新时间:2023-10-28 22:00:09 25 4
gpt4 key购买 nike

在发布这个问题时,我想出了答案,但我会在这里发布,以防它帮助其他人,也许有人可以帮助解决发生的原因

当我运行时:

sudo npm install -g grunt

它的最后一部分说:

/usr/bin/grunt -> /usr/lib/node_modules/grunt/bin/grunt
npm ERR! peerinvalid The package flatiron does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer flatiron-cli-config@0.1.3 wants flatiron@~0.1.9
npm ERR! peerinvalid Peer flatiron-cli-users@0.1.1 wants flatiron@~0.1.9

npm ERR! System Linux 3.5.0-23-generic
npm ERR! command "nodejs" "/usr/bin/npm" "install" "-g" "grunt"
npm ERR! cwd /home/explunit
npm ERR! node -v v0.8.19
npm ERR! npm -v 1.2.9
npm ERR! code EPEERINVALID
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/explunit/npm-debug.log
npm ERR! not ok code 0

正如您在上面看到的,我使用的是 Node 0.8.19 和 npm 1.2.9(来自 Ubuntu 12.10 上的 ppa:chris-lea 的最新版本)。

我尝试过的其他事情:

  • 在全新的 Ubuntu 安装中也这样做了。没有错误。在最后几个错误行之前,脚本输出看起来是一样的。
  • 运行“sudo npm cache clean”并再次尝试。不走运。
  • 运行“npm list”,没有列出任何其他内容

最佳答案

我的错误是没有在 npm list 命令上附加 -g。

npm list -g

完成此操作后,我看到了全局安装的模块列表(例如 bower、jshint、mocha),并且在最后:

npm ERR! peer invalid: flatiron@0.3.0 /usr/lib/node_modules/jitsu/node_modules/flatiron
npm ERR! not ok code 0

然后我运行这个命令来查看哪些正在使用 flatiron:

npm list -g flatiron

在这种情况下,它是 jitsu,一个我不再使用的模块。我跑了

sudo npm uninstall -g jitsu
sudo npm uninstall -g grunt

然后再次运行原始命令。 请稍后回答此问题的任何人注意:在 release of 0.4 之后全局重新安装 grunt 命令行的正确模块现在是 grunt-cli,而不是像我问原始问题时那样的 grunt

如果我真的想保留 jitsu,我可以更新它而不是卸载它(感谢 @BenAtkin):

npm install -g jitsu

然后再次运行原始命令。见 this blog post about peerDependency being added in node 0.8.19了解更多背景信息。

关于node.js - npm peerDependency 问题与 grunt 和 flatiron peer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14885084/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com