Error installing forge-cli on enterprise windows device

Hi there, I’m trying to install the latest forge-cli via npm onto a windows device in an enterprise environment. I’m getting an issue about local issuer certificate as it’s trying to download node v22 files from the public site for some reason… normally we install from a proxy (nexus) and i’m not sure why it’s even pulling these files in…

Here is the error log ending output:

1079 info run keytar@7.9.0 install { code: 1, signal: null }
1080 warn cleanup Failed to remove some directories [
1080 warn cleanup   [
1080 warn cleanup     '\\\\?\\C:\\Users\\username\\AppData\\Roaming\\npm\\node_modules\\@forge\\cli\\node_modules\\@sentry\\core',
1080 warn cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\username\AppData\Roaming\npm\node_modules\@forge\cli\node_modules\@sentry\core'] {
1080 warn cleanup       errno: -4048,
1080 warn cleanup       code: 'EPERM',
1080 warn cleanup       syscall: 'rmdir',
1080 warn cleanup       path: 'C:\\Users\\username\\AppData\\Roaming\\npm\\node_modules\\@forge\\cli\\node_modules\\@sentry\\core'
1080 warn cleanup     }
1080 warn cleanup   ],
1080 warn cleanup   [
1080 warn cleanup     'C:\\Users\\username\\AppData\\Roaming\\npm\\node_modules\\@forge\\cli',
1080 warn cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\username\AppData\Roaming\npm\node_modules\@forge\cli\node_modules\@sentry\node\node_modules\@sentry'] {
1080 warn cleanup       errno: -4048,
1080 warn cleanup       code: 'EPERM',
1080 warn cleanup       syscall: 'rmdir',
1080 warn cleanup       path: 'C:\\Users\\username\\AppData\\Roaming\\npm\\node_modules\\@forge\\cli\\node_modules\\@sentry\\node\\node_modules\\@sentry'
1080 warn cleanup     }
1080 warn cleanup   ],
1080 warn cleanup   [
1080 warn cleanup     '\\\\?\\C:\\Users\\username\\AppData\\Roaming\\npm\\node_modules\\@forge\\cli\\node_modules\\@sentry-internal',
1080 warn cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\username\AppData\Roaming\npm\node_modules\@forge\cli\node_modules\@sentry-internal\tracing\esm\browser'] {
1080 warn cleanup       errno: -4048,
1080 warn cleanup       code: 'EPERM',
1080 warn cleanup       syscall: 'rmdir',
1080 warn cleanup       path: 'C:\\Users\\username\\AppData\\Roaming\\npm\\node_modules\\@forge\\cli\\node_modules\\@sentry-internal\\tracing\\esm\\browser'
1080 warn cleanup     }
1080 warn cleanup   ],
1080 warn cleanup   [
1080 warn cleanup     '\\\\?\\C:\\Users\\username\\AppData\\Roaming\\npm\\node_modules\\@forge\\cli',
1080 warn cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\username\AppData\Roaming\npm\node_modules\@forge\cli\node_modules\@sentry-internal\tracing\node_modules\@sentry'] {
1080 warn cleanup       errno: -4048,
1080 warn cleanup       code: 'EPERM',
1080 warn cleanup       syscall: 'rmdir',
1080 warn cleanup       path: 'C:\\Users\\username\\AppData\\Roaming\\npm\\node_modules\\@forge\\cli\\node_modules\\@sentry-internal\\tracing\\node_modules\\@sentry'
1080 warn cleanup     }
1080 warn cleanup   ]
1080 warn cleanup ]
1081 verbose stack Error: command failed
1081 verbose stack     at promiseSpawn (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:22:22)
1081 verbose stack     at spawnWithShell (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:124:10)
1081 verbose stack     at promiseSpawn (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:12:12)
1081 verbose stack     at runScriptPkg (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\run-script\lib\run-script-pkg.js:77:13)
1081 verbose stack     at runScript (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\run-script\lib\run-script.js:9:12)
1081 verbose stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\rebuild.js:329:17
1081 verbose stack     at run (C:\Program Files\nodejs\node_modules\npm\node_modules\promise-call-limit\dist\commonjs\index.js:67:22)
1081 verbose stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\promise-call-limit\dist\commonjs\index.js:84:9
1081 verbose stack     at new Promise (<anonymous>)
1081 verbose stack     at callLimit (C:\Program Files\nodejs\node_modules\npm\node_modules\promise-call-limit\dist\commonjs\index.js:35:69)
1082 verbose pkgid keytar@7.9.0
1083 error code 1
1084 error path C:\Users\username\AppData\Roaming\npm\node_modules\@forge\cli\node_modules\keytar
1085 error command failed
1086 error command C:\WINDOWS\system32\cmd.exe /d /s /c prebuild-install || npm run build
1087 error > keytar@7.9.0 build
1087 error > node-gyp rebuild
1088 error prebuild-install WARN install unable to get local issuer certificate
1088 error gyp info it worked if it ends with ok
1088 error gyp info using node-gyp@11.0.0
1088 error gyp info using node@22.13.1 | win32 | x64
1088 error gyp info find Python using Python version 3.12.9 found at "C:\Program Files\Python312\python.exe"
1088 error gyp http GET url:nodejs.org/download/release/v22.13.1/SHASUMS256.txt
1088 error gyp http GET url:nodejs.org/download/release/v22.13.1/win-x64/node.lib
1088 error gyp http fetch GET url:nodejs.org/download/release/v22.13.1/SHASUMS256.txt attempt 1 failed with UNABLE_TO_GET_ISSUER_CERT_LOCALLY
1088 error gyp http fetch GET url:nodejs.org/download/release/v22.13.1/win-x64/node.lib attempt 1 failed with UNABLE_TO_GET_ISSUER_CERT_LOCALLY
1088 error gyp WARN install got an error, rolling back install
1088 error gyp ERR! configure error 
1088 error gyp ERR! stack FetchError: request to url:nodejs.org/download/release/v22.13.1/SHASUMS256.txt failed, reason: unable to get local issuer certificate
1088 error gyp ERR! stack at ClientRequest.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14)
1088 error gyp ERR! stack at ClientRequest.emit (node:events:524:28)
1088 error gyp ERR! stack at emitErrorEvent (node:_http_client:104:11)
1088 error gyp ERR! stack at _destroy (node:_http_client:898:9)
1088 error gyp ERR! stack at onSocketNT (node:_http_client:918:5)
1088 error gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:91:21)
1088 error gyp ERR! System Windows_NT 10.0.22631
1088 error gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
1088 error gyp ERR! cwd C:\Users\username\AppData\Roaming\npm\node_modules\@forge\cli\node_modules\keytar
1088 error gyp ERR! node -v v22.13.1
1088 error gyp ERR! node-gyp -v v11.0.0
1088 error gyp ERR! not ok
1089 silly unfinished npm timer reify 1746631082852
1090 silly unfinished npm timer reify:build 1746631110914
1091 silly unfinished npm timer build 1746631110915
1092 silly unfinished npm timer build:deps 1746631110915
1093 silly unfinished npm timer build:run:install 1746631111287
1094 silly unfinished npm timer build:run:install:node_modules/@forge/cli/node_modules/keytar 1746631111287
1095 verbose cwd C:\dev\rovo-agent
1096 verbose os Windows_NT 10.0.22631
1097 verbose node v22.13.1
1098 verbose npm  v10.9.2
1099 verbose exit 1
1100 verbose code 1

Hi,

You can follow this guide here: https://developer.atlassian.com/platform/forge/enterprise/use-forge-cli-on-corporate-network/

I have also let the team owning the CLI know to have a look at your logs.

Cheers
Ben

Thanks for replying, still no dice, I’m getting a “certificate error” and I have an internal registry already set but it still keeps trying to call out… is there a pre-set forge-cli package that I can just download and put in my global npm registry?