top of page

Node.js installation error with 'fnm use'

I was installing Node.js in Windows 11 for the first time. Following the instructions on website, screenshot below.

Started PowerShell, the first command was executed successfully and Fast Node Manager (fnm) was installed successfully. I had to restart the PowerShell for the fnm command to come into effect.

Second line of command, however, hit an error "We can't find the necessary environment variables to replace the Node version.".

Then maybe I try installing it first by running command 'fnm install 20'. Node.js version 20.15.0 was installed successfully.

When I run 'fnm use 20', the same error occurred.

Searched for solution online for a while, found nothing until I came across Hotaru Komajou's post at

Executing below line solved the issue, and things seem to be going well after.

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

That's all for this post.


Recent Posts

See All


bottom of page