【问题标题】:"Your npm version is outdated." but it's not. While install yo“你的 npm 版本已经过时了。”但事实并非如此。安装时哟
【发布时间】:2015-06-08 17:39:45
【问题描述】:

在 Windows 7 64 位上。通过向导安装了 Node.js,它给了我 npm。

我运行 npm install -g yo 并得到以下结果

您的 npm 版本已过时。

完整输出:

C:\Users\dlite922>npm install -g yo
|


> spawn-sync@1.0.11 postinstall C:\Users\dlite922\AppData\Roaming\npm\node_modules\yo\node_modules\cross-spawn\node_modules\spaw
> node postinstall

C:\Users\dlite922\AppData\Roaming\npm\yo -> C:\Users\dlite922\AppData\Roaming\npm\node_modules\yo\lib\cli.js

> yo@1.4.7 postinstall C:\Users\dlite922\AppData\Roaming\npm\node_modules\yo
> yodoctor


Yeoman Doctor
Running sanity checks on your system

√ Global configuration file is valid
√ NODE_PATH matches the npm root
√ Node.js version
× npm version

Your npm version is outdated.

Upgrade to the latest version by running:
npm install -g npm

See this guide if you're having trouble upgrading:
https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows

√ No .bowerrc file in home directory
√ No .yo-rc.json file in home directory

Found potential issues on your machine :(
yo@1.4.7 C:\Users\dlite922\AppData\Roaming\npm\node_modules\yo
├── titleize@1.0.0
├── array-uniq@1.0.2
├── figures@1.3.5
├── user-home@1.1.1
├── opn@1.0.2
├── async@1.2.1
├── humanize-string@1.0.1 (decamelize@1.0.0)
├── sort-on@1.2.0 (dot-prop@2.1.0)
├── string-length@1.0.0 (strip-ansi@2.0.1)
├── yeoman-character@1.0.1 (supports-color@1.3.1)
├── findup@0.1.5 (commander@2.1.0, colors@0.6.2)
├── meow@3.1.0 (object-assign@2.1.1, minimist@1.1.1, camelcase-keys@1.0.0, indent-string@1.2.1)
├── yosay@1.0.4 (ansi-regex@1.1.1, pad-component@0.0.1, ansi-styles@2.0.1, word-wrap@1.0.3, strip-ansi@2.0.1, minimist@1.1.1, take
├── chalk@1.0.0 (escape-string-regexp@1.0.3, ansi-styles@2.0.1, supports-color@1.3.1, strip-ansi@2.0.1, has-ansi@1.0.3)
├── root-check@1.0.0 (sudo-block@1.2.0, downgrade-root@1.1.0)
├── repeating@1.1.3 (is-finite@1.0.1)
├── configstore@1.0.0 (object-assign@2.1.1, xdg-basedir@1.0.1, osenv@0.1.1, graceful-fs@3.0.8, uuid@2.0.1, mkdirp@0.5.1)
├── update-notifier@0.5.0 (is-npm@1.0.0, latest-version@1.0.0, semver-diff@2.0.0)
├── package-json@1.2.0 (registry-url@3.0.3)
├── got@3.2.0 (lowercase-keys@1.0.0, timed-out@2.0.0, is-stream@1.0.1, prepend-http@1.0.1, object-assign@2.1.1, nested-error-stack
fy@3.4.1)
├── npm-keyword@1.1.1 (registry-url@3.0.3, got@2.9.2)
├── fullname@1.1.0 (npmconf@2.1.2)
├── cross-spawn@0.4.0 (lru-cache@2.6.4, spawn-sync@1.0.11)
├── yeoman-environment@1.2.5 (untildify@2.0.0, escape-string-regexp@1.0.3, log-symbols@1.0.2, diff@1.4.0, text-table@0.2.0, debug@
├── lodash@3.9.3
├── yeoman-doctor@1.4.0 (object-values@1.0.0, log-symbols@1.0.2, each-async@1.1.1, semver@4.3.6, bin-version-check@2.1.0, twig@0.8
├── inquirer@0.8.5 (ansi-regex@1.1.1, cli-width@1.0.1, through@2.3.7, readline2@0.1.1, rx@2.5.3)
└── insight@0.6.0 (object-assign@2.1.1, async@0.9.2, lodash.debounce@3.1.0, os-name@1.0.3, tough-cookie@1.2.0, request@2.57.0)

但我有一个相当新的 npm 版本:

C:\Users\dlite922>npm -v
2.10.1

我按照故障排除并将我的 %appdata% npm BEFORE nodejs 放在我的 %PATH% 列表中,但仍然得到上面的响应。

运气好吗?

PS:顺便说一下,这个平均堆栈是如此杂乱无章。有 5000 万种安装方式,并且都在他们的首页上宣传快速的两步安装,就像这是世界上最简单的事情一样。然后,当他们假设安装的 20 个先决条件不起作用时,每个人都会感到愚蠢。如果如今 javascript 处于领先地位,那么 Web 应用程序开发的未来将一团糟。我认为 PHP 的日子不好过。哈哈 /endRant

【问题讨论】:

  • 提交错误报告:github.com/yeoman/doctor/issues 这可能只是没有正确检测您的 NPM 版本。此外,根据该输出,它看起来确实正确安装了yo。它不工作吗?最后,如果您忽略人们试图添加到其中的一些 BS 炒作,您将在 Node.js 世界中度过更好的时光。 Node.js 和 NPM 实际上是非常可靠的系统,而且确实很容易安装。但是,有很多人声称这是 方式,而事实是每个人的情况都有些不同。

标签: node.js npm yeoman mean-stack


【解决方案1】:

yo 包没有正确检测到您的npm 版本。安装的输出表明它安装正确。

【讨论】:

  • 你的意思是说yo包检测npm失败的错误很可能只是yo包的问题,​​可以忽略不计?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-02-15
  • 2018-09-05
  • 1970-01-01
  • 2021-06-06
  • 2013-05-28
  • 1970-01-01
  • 2021-03-21
相关资源
最近更新 更多