I can't install forge CLI

I’m trying to install Forge CLI but I can’t. After following the steps I can’t run Forge as a command on the command line. It just says it doesn’t recognise the command. Opening a new command line doesn’t help either. Here’s my command line:

Microsoft Windows [Version 10.0.19044.1889]
(c) Microsoft Corporation. All rights reserved.

C:\Users\mikel.rodriguez>node --version
v16.17.0

C:\Users\mikel.rodriguez>npm install -g @forge/cli

changed 606 packages, and audited 607 packages in 20s

19 vulnerabilities (3 moderate, 14 high, 2 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

C:\Users\mikel.rodriguez>forge --version
'forge' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\mikel.rodriguez>

I answer myself. The directory C:\Users\<your Windows user>\AppData\Roaming\npm must be in the Path environment variable before opening the command line. I thought this was handled automatically but it isn’t, I had to change the Path variable myself.

3 Likes

Thanks for posting the solution in case others run into the same problem.

1 Like