Error when trying to update to Forge CLI 1.2.0

Hi,

when I try to update to Forge CLI 1.2.0 I get the following error

npm ERR! code 1
npm ERR! path /Users/jonas/.nvm/versions/node/v12.21.0/lib/node_modules/@forge/cli
npm ERR! command failed
npm ERR! command sh -c node -e "process.exitCode = fs.existsSync('./out/bin/postinstall.js')" || node ./out/bin/postinstall.js
npm ERR! internal/modules/cjs/loader.js:818
npm ERR!   throw err;
npm ERR!   ^
npm ERR! 
npm ERR! Error: Cannot find module 'tslib'
npm ERR! Require stack:
npm ERR! - /Users/jonas/.nvm/versions/node/v12.21.0/lib/node_modules/@forge/cli/out/analytics-client/analytics-client.js
npm ERR! - /Users/jonas/.nvm/versions/node/v12.21.0/lib/node_modules/@forge/cli/out/bin/postinstall.js
npm ERR!     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
npm ERR!     at Function.Module._load (internal/modules/cjs/loader.js:667:27)
npm ERR!     at Module.require (internal/modules/cjs/loader.js:887:19)
npm ERR!     at require (internal/modules/cjs/helpers.js:74:18)
npm ERR!     at Object.<anonymous> (/Users/jonas/.nvm/versions/node/v12.21.0/lib/node_modules/@forge/cli/out/analytics-client/analytics-client.js:4:17)
npm ERR!     at Module._compile (internal/modules/cjs/loader.js:999:30)
npm ERR!     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
npm ERR!     at Module.load (internal/modules/cjs/loader.js:863:32)
npm ERR!     at Function.Module._load (internal/modules/cjs/loader.js:708:14)
npm ERR!     at Module.require (internal/modules/cjs/loader.js:887:19) {
npm ERR!   code: 'MODULE_NOT_FOUND',
npm ERR!   requireStack: [
npm ERR!     '/Users/jonas/.nvm/versions/node/v12.21.0/lib/node_modules/@forge/cli/out/analytics-client/analytics-client.js',
npm ERR!     '/Users/jonas/.nvm/versions/node/v12.21.0/lib/node_modules/@forge/cli/out/bin/postinstall.js'
npm ERR!   ]
npm ERR! }

I tried to install tslib with npm install tslib, it says that it is already installed and I get the same error again.
Could someone help me fixing this? Do I need to uninstall Forge CLI an install it again maybe?

Are you on one of the new Silicon Macs? I just ran into this problem and it’s an issue with TSC compatibility with Mac Silicon (or at least it was for me). After switching to using the homebrew install of node - I got Forge CLI working.

Apple Silicon plan · Issue #886 · nodejs/TSC · GitHub has more information

1 Like

Hi @danielwester
thanks for the hint. I don’t have a new Silicon Mac but it is a good idea to try the homebrew installation. Did you uninstall node before installing it with homebrew?

It worked with the homebrew installation. I successfully installed version 1.2.0 of Forge CLI. Thanks again!

1 Like