【发布时间】:2017-04-26 05:43:58
【问题描述】:
我正在使用 mac。我目前已经安装了 Node.js 4.4.3
Aleeshas-MacBook-Air:~ aleesha$ node -v
v4.4.3
我想按照这些steps 将 Node.js 更新到最新版本。
首先我尝试执行:brew update。但是,当我执行命令时出现以下错误:
brew update 错误:/usr/local 不可写。你应该改变 /usr/local 的所有权和权限还给您的用户帐户: sudo chown -R $(whoami) /usr/local
所以在谷歌上搜索解决方案后,我运行了这个命令:sudo chown -R $(whoami) /usr/local
之后我再次执行了brew update 命令。我认为它已成功执行,因为我没有看到任何错误消息。命令提示符的最后几行是:
==> 正在迁移 HOMEBREW_REPOSITORY(请稍候)... ==> 将 HOMEBREW_REPOSITORY 迁移到 /usr/local/Homebrew! Homebrew 不再需要拥有 /usr/local 的所有权。
如果你愿意 使用以下命令将 /usr/local 恢复为其默认所有权:sudo chown root:wheel /usr/local Aleeshas-MacBook-Air:~ aleesha$
但是在我执行升级命令的这一步之后,它失败了。
Aleeshas-MacBook-Air:~ aleesha$ brew upgrade node
Error: node not installed
Aleeshas-MacBook-Air:~ aleesha$
我不确定这里到底需要做什么。
谢谢
编辑:执行brew doctor 以检查系统异常。
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
【问题讨论】:
-
它说你没有安装节点。你有没有安装节点?
-
是,版本:
v4.4.3