How do brew install a specific version of Node?
For example, I want to install 7.9 or 7.10, but I want to avoid Node 8 due to a bug webpack node-sass
.
When I run brew search node
, this is what I see:
β― brew search nodeleafnode llnode Node β node -build> node @ 0.10 node @ 0.12 node @ 4 node @ 6 nodebrew nodeenv nodenv caskroom / barrel / node -profiler
If you meant "node": It was moved from barrel / barrel to homebrew / core. You can access it again by running: brew tap homebrew / core
Checked Node (my current version v7.4.0
, then node@0.10
, node@0.12
, node@4
and node@6
?
The reason I can't fully upgrade to 8 is node-sass won't work in webpack.
Just installed NVM and got this crazy error log:
=> nvm source string already in /Users/leongaban/.zshrc
=> Appending bash_completion source string to /Users/leongaban/.zshrc
npm ERR! missing: is-path-cwd@^1.0.0, required by del@3.0.0
npm ERR! missing: is-path-in-cwd@^1.0.0, required by del@3.0.0
npm ERR! missing: p-map@^1.1.1, required by del@3.0.0
npm ERR! missing: pify@^3.0.0, required by del@3.0.0
npm ERR! missing: rimraf@^2.2.8, required by del@3.0.0
npm ERR! missing: bluebird@^3.1.1, required by gulp-html-replace@1.6.2
npm ERR! missing: clone@^1.0.2, required by gulp-html-replace@1.6.2
...
=> You currently have modules installed globally with `npm`. These will no
=> longer be linked to the active version of Node when you install a new node
=> with `nvm`; and they may (depending on how you construct your `$PATH`)
=> override the binaries of modules installed with `nvm`:
If I am reading this right, does it mean that I cannot use npm
to more fully install packages and use nvm
?
Update
I have added export lines to my .zshrc bash (I am not using bash_profile)
β― nvm --version
0.33.2
source to share
If the versions are not homebrew/code
defined correctly, you should also be able to brew install node@0.12
.
You can also install multiple versions and choose which one you want to use using the command brew switch
.
-
Anyway, I would recommend using nvm , which can be installed via Homebrew. Although the version brew
is not wrong, and they do not plan to fix it.
source to share