Skip to content

Node.js

Installation

WSL

To configure Node.js, I use fnm on WSL.

Terminal window
curl -fsSL https://fnm.vercel.app/install | bash

At the moment of this writing, the installation performed was v20.10.0 (LTS):

Terminal window
fnm install v20.10.0

Windows

On Windows, sometimes npm is required (i.e., spotless plug-in for java with prettier). Thus, we also install fnm in Windows with a node implementation:

Terminal window
winget install Schniz.fnm

Then add to the end of the profile (notepad $PROFILE) the following lines:

Terminal window
fnm env --use-on-cd | Out-String | Invoke-Expression

IDEs

As we are using fnm, node is not added by default to the PATH unless we are on a terminal. To fix this in IDEs that does not support it, each IDE should take care of the configuration.