Install NodeJS development environment, the right way.

$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
$ nvm install --lts
$ nvm alias default $(nvm current)$ brew install nvm
$ nvm install --lts
$ nvm alias default $(nvm current)NVM commands to know:
- List available remote LTS versions:
nvm ls-remote --lts
- List locally installed versions:
nvm ls
- Install a specific LTS version (using its code name)
nvm install Erbium
- To switch to another version for the active shell use nvm use.
nvm use 12.16.3
- To switch to the latest installed version:
nvm use node
- To switch to the latest LTS version:
nvm use --lts
- To switch the version of Node.js used by default when starting a new shell
nvm alias default {VERSION}
- To get current used version
nvm current
- Set the current used version as the default
nvm alias default $(nvm current)
npm install -g windows-build-toolsAs an alternative, you can manually install VSCode 2015:
Install the build tool 2015 from Microsoft
Set VS 2015 as default version:
npm config set msvs_version 2015Adding 2 directories in your windows path:
C:\Program Files (x86)\MSBuild\14.0\Bin\amd64C:\Program Files (x86)\MSBuild\14.0\BinInstall node-gyp from an administrator cmd:
npm install -g --msvs_version=2015 node-gyp rebuildmsbuild /versionnpm config set proxy http://<proxy url>:<proxy port>👉 Don't forget to follow me on Twitter to be notified when new posts are available!