Is it ok to link node@6
by force?
$ which node
$ echo $?
1
$ brew link node
Error: No such keg: /usr/local/Cellar/node
$ brew search node
leafnode llnode node node-build [email protected] [email protected] node@4 node@5 node@6 ✔ nodebrew nodeenv nodenv
Caskroom/cask/mindnode-pro Caskroom/cask/node-profiler Caskroom/cask/nodebox Caskroom/cask/nodeclipse Caskroom/cask/printnode Caskroom/cask/soundnode
$ brew link node@6
Warning: node@6 is keg-only and must be linked with --force
Note that doing so can interfere with building software.
Edit:
I went ahead and did it:
$ brew link node@6 --force
Linking /usr/local/Cellar/node@6/6.9.5... 7 symlinks created
node
and npm
work fine now.
Scary warning.
Node. js versions are mostly backward compatible, meaning that code you wrote for Node 8 will work on Node 10 or 12. Thus, if you only have plain old JavaScript you should face no difficulties upgrading.
Use the engines keyword in the package. json file to specify the Node. js version that you want your application to use. You can also specify a version range using npm notation.
I ran in to the same problem and followed the advice of brew info node@6
and added export PATH="/usr/local/opt/node@6/bin:$PATH
to my .bash_profile. All the command line tools worked as expected.
(I've actually removed that line for my .bash_profile now and added an alias to set the path manually when I need it.)
You may (I have) run into some Cellar issues..
What is the output you got from brew doctor?
I had this when executing brew doctor
:
Warning: Some keg-only formula are linked into the Cellar.
Linking a keg-only formula, such as gettext, into the cellar with
brew link <formula>
will cause other formulae to detect them during
the ./configure
step. This may cause problems when compiling those
other formulae.
I had to execute brew unlink node@6
for it to return 'your system is ready to brew'.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With