简体   繁体   中英

Unable to link/run Node.js v6 in Homebrew

I'm trying to specifically install Node.js v6, which is proving confusingly difficult.

On a new MacBook running Sierra, I've run: brew install node@6

This gave me:

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/node@6/bin:$PATH"' >> ~/.zshrc

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/node@6/lib
    CPPFLAGS: -I/usr/local/opt/node@6/include


Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
🍺  /usr/local/Cellar/node@6/6.9.5: 3,891 files, 41.3M

If I run which node , I get node not found . If I run brew link node , I get Error: No such keg: /usr/local/Cellar/node . I also ran sudo chown -R $USER /usr/local .

How can I "link" Node.js v6 so that other software can find it? Do I run echo 'export PATH="/usr/local/opt/node@6/bin:$PATH"' >> ~/.zshrc ? I don't want to run anything I'm not sure of.

Don't use Homebrew to install node.

I like the Node Version Manager (NVM) , and there is n (as mentioned by @ntalbs in the comments). These are better options on a Mac for node, to avoid certain . issues . later .

Note, you can install nvm and n via Homebrew. ( brew install nvm or brew install n ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM