天天看點

brew install node 報錯:Error: No such file or directory @ dir_chdir Bottle installation failed:

在終端輸入 brew install node 回車 報錯如下圖

brew install node

==> Installing dependencies for node: icu4c

==> Installing node dependency: icu4c

==> Downloading https://homebrew.bintray.com/bottles/icu4c-62.1.mojave.bottle.ta

Already downloaded:

/Users/lvhongjian/Library/Caches/Homebrew/downloads/2ac513734226effaf79e199fb1612ebce7842df443578bcd61afd73767858aef–icu4c-62.1.mojave.bottle.tar.gz

Error: No such file or directory @ dir_chdir - /usr/local/Cellar

Warning: Bottle installation failed: building from source.

==> Downloading https://ssl.icu-project.org/files/icu4c/62.1/icu4c-62_1-src.tgz

Already downloaded:

/Users/lvhongjian/Library/Caches/Homebrew/downloads/b79f5dd51110fb1096e57fc35ba03df84f69142b0374bae8a0381edde5a80448–icu4c-62_1-src.tgz

Error: An exception occurred within a child process: Errno::EPERM:

Operation not permitted @ dir_s_mkdir - /usr/local/Cellar

解決辦法

由于登陸使用者不是HomeBrew的安裝使用者、是以報以上錯誤這裡解決如下:
1.在目前使用者重新安裝HomeBrew /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2.運作brew install node提示成功