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-tools
As 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 2015
Adding 2 directories in your windows path:
C:\Program Files (x86)\MSBuild\14.0\Bin\amd64
C:\Program Files (x86)\MSBuild\14.0\Bin
Install node-gyp from an administrator cmd:
npm install -g --msvs_version=2015 node-gyp rebuild
msbuild /version
npm config set proxy http://<proxy url>:<proxy port>
👉 Don't forget to follow me on Twitter to be notified when new posts are available!
Follow @jcbaey