【问题标题】:Can't install Yeoman on Ubuntu because my nodejs and npm are outdated无法在 Ubuntu 上安装 Yeoman,因为我的 nodejs 和 npm 已过时
【发布时间】: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 没有安装。

标签: node.js ubuntu npm yeoman


【解决方案1】:

你应该跑

npm install -g npm

不是

npm install -g n

根据你的输出

【讨论】:

  • 当我尝试运行 npm install -g npm, /usr/bin/env: node: File or directory not found 时遇到同样的错误
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-11-24
  • 2016-03-01
  • 2014-11-09
  • 1970-01-01
  • 2014-03-06
  • 2022-12-18
  • 1970-01-01
相关资源
最近更新 更多