2017-02-02 46 views
2

我想特別安裝Node.js v6,這證明困難困難。無法鏈接/運行Node.js v6在Homebrew

在運行塞拉利昂一個新的MacBook,我已經運行: brew install [email protected]

這給了我:

Please note by default only English locale support is provided. If you need 
full locale support you should either rebuild with full icu: 
    `brew reinstall node --with-full-icu` 
or add full icu data at runtime following: 
    https://github.com/nodejs/node/wiki/Intl#using-and-customizing-the-small-icu-build 

This formula is keg-only, which means it was not symlinked into /usr/local. 

This is an alternate version of another formula. 

If you need to have this software first in your PATH run: 
    echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc 

For compilers to find this software you may need to set: 
    LDFLAGS: -L/usr/local/opt/[email protected]/lib 
    CPPFLAGS: -I/usr/local/opt/[email protected]/include 


Bash completion has been installed to: 
    /usr/local/etc/bash_completion.d 
==> Summary 
    /usr/local/Cellar/[email protected]/6.9.5: 3,891 files, 41.3M 

如果我跑which node,我得到node not found。如果我運行brew link node,我得到Error: No such keg: /usr/local/Cellar/node。我也跑了sudo chown -R $USER /usr/local

如何「鏈接」Node.js v6以便其他軟件可以找到它?我是否運行echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc?我不想運行任何我不確定的事情。

+0

我寧願使用'n'。 https://github.com/tj/n – ntalbs

回答

7

不要使用Homebrew來安裝節點。

我喜歡Node Version Manager (NVM),並且有n(正如評論中的@ntalbs所述)。對於節點的Mac,這是更好的選擇,以避免certainissueslater

請注意,您可以通過Homebrew安裝nvmn。 (brew install nvmbrew install n)。

+0

是的,我投入並使用了'n'。我只追求自制,因爲它在另一臺機器上工作(着名的遺言)。謝謝你的提示 –