本文介绍了更新Node.js:在Mac上更新Node.js时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用mac.我目前已经安装了Node.js 4.4.3

I am using mac. I have currently installed Node.js 4.4.3

Aleeshas-MacBook-Air:~ aleesha$ node -v
v4.4.3

我想通过遵循以下.

首先,我尝试执行:酿造更新.但是,执行命令时出现以下错误:

First I tried to execute: brew update. However, I was getting the below error when I executed the command:

因此,在Google上搜索解决方案后,我运行了以下命令: sudo chown -R $(whoami)/usr/local

So after searching for solution on Google, I ran this command: sudo chown -R $(whoami) /usr/local

之后,我再次执行了 brew update 命令.我认为它已成功执行,因为我没有看到任何错误消息.命令提示符上的最后几行是:

After that I again executed the brew update command. I think it was successfully executed since I didn't see any error message. Last few lines on the command prompt were:

如果您愿意,可以使用以下命令将/usr/local返回其默认所有权:sudo chownroot:wheel/usr/local Aleeshas-MacBook-Air:〜aleesha $

If you wish you can return /usr/local to its default ownership with: sudo chown root:wheel /usr/local Aleeshas-MacBook-Air:~ aleesha$

但是,在执行升级命令的此步骤之后,它失败了.

However after this step when I execute the upgrade command, it failed.

Aleeshas-MacBook-Air:~ aleesha$ brew upgrade node
Error: node not installed
Aleeshas-MacBook-Air:~ aleesha$

我不确定在这里到底需要做什么.

I am not sure what exactly needs to be done here.

谢谢

编辑:执行了 brew医生以检查系统异常.

Executed brew doctor to check for system anomalies.

Aleeshas-MacBook-Air:~ aleesha$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
  /Library/Frameworks/Python.framework/Versions/3.5/bin/python3-config
  /Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5-config
  /Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5m-config

Warning: No developer tools installed.
Install the Command Line Tools:
  xcode-select --install


Warning: Python is installed at /Library/Frameworks/Python.framework

Homebrew only supports building against the System-provided Python or a
brewed Python. In particular, Pythons installed to /Library can interfere
with other software installs.

Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected header files:
  /usr/local/include/node/android-ifaddrs.h
  /usr/local/include/node/ares.h
  /usr/local/include/node/ares_version.h
  /usr/local/include/node/libplatform/libplatform.h
  /usr/local/include/node/nameser.h
  /usr/local/include/node/node.h
  /usr/local/include/node/node_buffer.h

推荐答案

您未使用Homebrew安装Node,请使用此要点可卸载您当前安装的Node.

You didn't install Node using Homebrew, use this gist to uninstall your current installation of Node.

然后:

brew update && brew install node

这篇关于更新Node.js:在Mac上更新Node.js时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-28 11:24
查看更多