node.js - "Your npm version is outdated."但事实并非如此。安装时哟

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

运气好吗?

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

最佳答案

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

关于node.js - "Your npm version is outdated."但事实并非如此。安装时哟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30715674/

相关文章:

Javascript:使用 setTimeout 重试的函数

angularjs - yeoman/哟 : Where does Yo scaffolding pickup the name of the Angular module?

AngularJS 和 Karma,无法调用未定义的方法 'module'

typescript - 如何解析、修改和重新生成 TypeScript 文件(如 jscodeshift)的 AST?

node.js - 如何使用elasticsearch-js(或其他方式)根据查询更新文档?

node.js - 正确的 Mongodb 查询相当于 SQL 查询

javascript - 停止用户从控制台执行 JavaScript

ssl - Nexus:登录到 Nginx 代理后面的 NPM 存储库的 SSL 问题

javascript - 从 NPM( Node 模块)解析 nunjucks 模板?

docker - 在 gitlab 管道中安装私有(private) npm 包