"你的npm版本已经过时了。"但事实并非如此。安装哟

时间:2015-06-08 17:39:46

标签: node.js npm yeoman mean-stack

在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节点放在我的%PATH%列表中,但仍然得到上面的响应。

运气好吗?

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

1 个答案:

答案 0 :(得分:5)

yo软件包未正确检测到您的npm版本。安装的输出表明它已正确安装。