【发布时间】:2016-06-08 20:14:01
【问题描述】:
我正在尝试通过 npm 安装 Yeoman,但在运行 npm install -g yo 时出现以下错误:
npm WARN deprecated npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
/home/marieficid/.node/bin/yo -> /home/marieficid/.node/lib/node_modules/yo/lib/cli.js
> yo@1.6.0 postinstall /home/marieficid/.node/lib/node_modules/yo
> yodoctor
Yeoman Doctor
Running sanity checks on your system
✔ Global configuration file is valid
✖ Node.js version
Your Node.js version is outdated.
Upgrade to the latest version: https://nodejs.org
✔ No .bowerrc file in home directory
✔ No .yo-rc.json file in home directory
✖ npm version
Your npm version is outdated.
Upgrade to the latest version by running:
npm install -g npm
✔ NODE_PATH matches the npm root
Found potential issues on your machine :(
/home/marieficid/.node/lib
└── yo@1.6.0
这很奇怪,因为当我运行 node --version && npm --version 时,我得到:
v4.3.1
3.7.3
当我尝试运行 npm install -g n 时,我得到:
/home/marieficid/.node/bin/n -> /home/marieficid/.node/lib/node_modules/n/bin/n
/home/marieficid/.node/lib
└── n@2.1.0
我尝试运行this solution,这只会给我带来更多问题:现在我无法运行节点--version,只有n --version,它返回2.1.0,我无法运行npm install -g n,因为我得到这个:
marieficid@mariana-K46CB:~$ npm install -g n
/usr/bin/env: node: Arquivo ou diretório não encontrado
这意味着“找不到目录”。我能做些什么?顺便说一句,我使用的是 Ubuntu 14.04。
编辑:我想我搞砸了我的 $PATH 变量...有人知道如何修复它吗?
【问题讨论】:
-
我认为 yeoman 只是让您知道您是 node 并且 npm 版本已过时。我不认为这意味着 yeoman 没有安装。