How to Brew Install Specific Version of Node?

How to Brew Install Specific Version of Node?

For example I want to install either 7.9 or 7.10 but want to avoid Node 8 due to the webpack node-sass breaking bug.

When I run brew search node this is what I see:

❯ brew search node leafnode llnode node ✔ node-build > node@0.10 node@0.12 node@4 node@6 nodebrew nodeenv nodenv caskroom/cask/node-profiler

If you meant "node" specifically: It was migrated from caskroom/cask to homebrew/core. You can access it again by running: brew tap homebrew/core

There is node which is checked (my current version is v7.4.0 then node@0.10, node@0.12, node@4 and node@6?

The reason I can't just 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'm reading this right, does this mean I can't use npm to globally install packages anymore and have to use nvm?

Update

I added the export lines to my .zshrc bash (I don't use bash_profile)

❯ nvm --version
0.33.2
4

4 Answers

There are two ways in the decision for using different version of Node. Second way is more convenient and practical by my opinion.


Robert Thorne
Author

Robert Thorne

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.