Forge-cli could not be installed

Hello everyone,

I am trying to install forge: npm install -g @forge/cli

The node version is 20.13.1 and npm version is 10.5.2

The error that I encountered when trying to install Forge is mentioned below:

npm ERR! command C:\WINDOWS\cmd.exe /d /s /c node -e “fs.existsSync(‘./out/bin/postinstall.js’) && require(‘./out/bin/postinstall.js’)”
npm ERR! const attributes = { version: cliDetails?.version };
npm ERR! ^
npm ERR!
npm ERR! SyntaxError: Unexpected token

Thank you in advance

think it might be a compatibility issue with the Node version. Try using a different version, such as Node v18.17.0 (LTS), to see if the error persists.

Yes @FelipeCauFragaCarnei , I tried also lower versions of node, such as the one you mentioned (v18.17.0) but still getting the same error.

The only forge version that is installing is v6.3.0

But with that version when I try to deploy the app I get this

Unfortunately tried with every single LTS version of node and also with their compatible npm version but still no luck with installing latest forge version

I had the same issue when installing the version. What worked for me was running npm prune @forge/cli followed by npm cache clean --force .

1 Like

Unfortunately didn’t help this also…