Not able to install forge-CLI on windows

I got this error after using “npm install -g @forge/cli” this command

C:\Windows\System32>npm install -g @forge/cli
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated gar@1.0.4: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm warn deprecated npmlog@4.1.2: This package is no longer supported.
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated json-schema-ref-parser@9.0.9: Please switch to @apidevtools/json-schema-ref-parser
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated glob@8.1.0: Glob versions prior to v9 are no longer supported
npm warn deprecated are-we-there-yet@1.1.7: This package is no longer supported.
npm warn deprecated gauge@2.7.4: This package is no longer supported.
npm warn deprecated memfs@3.6.0: this will be v4
npm warn cleanup Failed to remove some directories [
npm warn cleanup   [
npm warn cleanup     'C:\\Users\\Chinmay Borkar\\AppData\\Roaming\\npm\\node_modules\\@forge\\cli',
npm warn cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\Chinmay Borkar\AppData\Roaming\npm\node_modules\@forge\cli\node_modules\@types\serve-static\node_modules\@types'] {
npm warn cleanup       errno: -4048,
npm warn cleanup       code: 'EPERM',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: 'C:\\Users\\Chinmay Borkar\\AppData\\Roaming\\npm\\node_modules\\@forge\\cli\\node_modules\\@types\\serve-static\\node_modules\\@types'
npm warn cleanup     }
npm warn cleanup   ],
npm warn cleanup   [
npm warn cleanup     'C:\\Users\\Chinmay Borkar\\AppData\\Roaming\\npm\\node_modules\\@forge\\cli\\node_modules\\@types\\serve-static',
npm warn cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\Chinmay Borkar\AppData\Roaming\npm\node_modules\@forge\cli\node_modules\@types\serve-static\node_modules'] {
npm warn cleanup       errno: -4048,
npm warn cleanup       code: 'EPERM',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: 'C:\\Users\\Chinmay Borkar\\AppData\\Roaming\\npm\\node_modules\\@forge\\cli\\node_modules\\@types\\serve-static\\node_modules'
npm warn cleanup     }
npm warn cleanup   ],
npm warn cleanup   [
npm warn cleanup     'C:\\Users\\Chinmay Borkar\\AppData\\Roaming\\npm\\node_modules\\@forge\\cli\\node_modules\\@types',
npm warn cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\Chinmay Borkar\AppData\Roaming\npm\node_modules\@forge\cli\node_modules\@types\serve-static'] {
npm warn cleanup       errno: -4048,
npm warn cleanup       code: 'EPERM',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: 'C:\\Users\\Chinmay Borkar\\AppData\\Roaming\\npm\\node_modules\\@forge\\cli\\node_modules\\@types\\serve-static'
npm warn cleanup     }
npm warn cleanup   ],
npm warn cleanup   [
npm warn cleanup     'C:\\Users\\Chinmay Borkar\\AppData\\Roaming\\npm\\node_modules\\@forge\\cli\\node_modules\\@cspotcode',
npm warn cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\Chinmay Borkar\AppData\Roaming\npm\node_modules\@forge\cli\node_modules\@cspotcode\source-map-support'] {
npm warn cleanup       errno: -4048,
npm warn cleanup       code: 'EPERM',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: 'C:\\Users\\Chinmay Borkar\\AppData\\Roaming\\npm\\node_modules\\@forge\\cli\\node_modules\\@cspotcode\\source-map-support'
npm warn cleanup     }
npm warn cleanup   ]
npm warn cleanup ]
npm error code 1
npm error path C:\Users\Chinmay Borkar\AppData\Roaming\npm\node_modules\@forge\cli\node_modules\cloudflared
npm error command failed
npm error command C:\windows\system32\cmd.exe /d /s /c node scripts/postinstall.mjs && node lib/cloudflared.js -v
npm error Installed cloudflared to C:\Users\Chinmay Borkar\AppData\Roaming\npm\node_modules\@forge\cli\node_modules\cloudflared\bin\cloudflared.exe
npm error 'C:\Users\Chinmay' is not recognized as an internal or external command,
npm error operable program or batch file.

npm error A complete log of this run can be found in: C:\Users\Chinmay Borkar\AppData\Local\npm-cache\_logs\2024-06-08T19_12_28_813Z-debug-0.log

Node version- 20.14.0
npm version- 10.7.0

What should I do to install forge-cli on windows? Is there node version or npm version has issue?

Hmm, it looks like somebody forgot paths can have spaces in the CLI tool or it’s dependencies.

Looks like a legit bug in the CLI, but I suspect if you do this in a path without spaces in the meantime it will work. Sorry for the hassle! I’ll report it to the team tomorrow.

2 Likes

I am facing the same issue. please help

This seems to be a bug with the latest version of the CLI occurring for path names containing spaces. Until this is fixed, you may try out the previous version of the CLI -
npm install @forge/cli@9.2.0 -g
OR
As @rmassaioli suggested above, get rid of spaces in path if possible. Eg. C:\Users\Chinmay Borkar\C:\Users\Chinmay-Borkar\

2 Likes

Hi @ShubhankSrivastava / @rmassaioli
As you suggested,
I have changed my user’s name now. And run this npm install @forge/cli@9.2.0 -g

But Now these deprecated issues are coming

C:\Users\chinmay>npm install @forge/cli@9.2.0 -g
npm warn deprecated gar@1.0.4: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm warn deprecated npmlog@4.1.2: This package is no longer supported.
npm warn deprecated json-schema-ref-parser@9.0.9: Please switch to @apidevtools/json-schema-ref-parser
npm warn deprecated are-we-there-yet@1.1.7: This package is no longer supported.
npm warn deprecated gauge@2.7.4: This package is no longer supported.
npm warn deprecated memfs@3.6.0: this will be v4

removed 1 package, and changed 997 packages in 27s

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

How can I install forge now? Please help.

Where should I run this command? I am doing all this in the command prompt.
Do I have to install docker on windows?

Anyone!!! please help to resolve this issue.

If it is related to the version on node,npm, docker, or forge… then please share the exact versions that you are using currently on the cloud.

Hey @chinmayborkar1 ,

As per the output pasted by you, it looks like forge was successfully installed.
You are now facing an issue with your PATH environment variable. Checkout I can't install forge CLI

Thanks @ShubhankSrivastava

The forge is installed now.

Now I am facing an error after using forge deploy

C:\Users\chinmay\AppData\Roaming\npm>forge deploy

C:\Users\chinmay\AppData\Roaming\npm\manifest.yml
0:0     error    To run this command, make sure you're in the top-level directory of your app, and the manifest.yml file is in the same directory.  manifest-file-required


Error: Command failed due to validation error.

Rerunning the command with --verbose may give more details.

C:\Users\chinmay\AppData\Roaming\npm>cd hello-world-app

C:\Users\chinmay\AppData\Roaming\npm\hello-world-app>forge deploy
'forge' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\chinmay\AppData\Roaming\npm\hello-world-app>

please help to resolve this error.

Path of manifest.yml file:
“C:\Users\chinmay\AppData\Roaming\npm\hello-world-app\manifest.yml”

Please!!! help to resolve this. Error is mention in above comment

This means that forge is not yet added to your system PATH variable otherwise you would be able to access it from any directory. In order to that in Windows, you can follow the instructions here link.
The path that you have to add is C:\Users\chinmay\AppData\Roaming\npm

2 Likes

Thank you so much @ShubhankSrivastava
All issues are resolved and the app is installed now.

1 Like

The issue with space characters in directory names is fixed in the CLI version 10.0.0.

2 Likes