I have upgraded to latest forge cli version 10.2.0 and when I am trying to run the command forge tunnel it is giving me the following error in the terminal:
Hi @TejasviGarg, the error that you are getting back (ENOENT) suggests that the Cloudflare binary included in the Forge CLI package is missing. I would suggest reinstalling the Forge CLI as a potential solution.
Hi @BoZhang
I can’t resolve this issue even if I reinstall forge CLI today. Could you please help take a look? Thanks.
Error: spawn /usr/local/lib/node_modules/@forge/cli/node_modules/cloudflared/bin/cloudflared ENOENT
/usr/local/lib/node_modules/@forge/cli/node_modules/@forge/tunnel/out/services/create-tunnel-service.js:33
throw new cli_shared_1.BaseError(undefined, cli_shared_1.Text.tunnel.error.cloudflaredError);
^
BaseError: Failed to start cloudflared. Rerunning the command with --verbose may give more details.
at ChildProcess.<anonymous> (/usr/local/lib/node_modules/@forge/cli/node_modules/@forge/tunnel/out/services/create-tunnel-service.js:33:19)
at ChildProcess.emit (node:events:514:28)
at ChildProcess.emit (node:domain:489:12)
at ChildProcess._handle.onexit (node:internal/child_process:289:12)
at onErrorNT (node:internal/child_process:476:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
requestId: undefined
}
Node.js v18.17.1
Hi @YY1, from the error message, it seems like the Cloudflare binary isn’t available for you local installation of the CLI. I can’t seem to reproduce this with the latest version. Can you let me know which version of the CLI you are using?
There shouldn’t have been any changes related to the tunnelling over the last couple of weeks.
I wasn’t able to reproduce it myself on version 10.13.1.
The error message that you are getting:
Seems to suggest that the Cloudflare binary doesn’t exist for the installation of Forge CLI that you are using. Can you double check that the Forge CLI you are re-installing is the one located here?
you shouldn’t have to install it manually, I am just wondering if the Forge CLI that you are re-installing is the one that is referencing the missing Cloudflare binary.
Oh, I’ve never noticed the registry in Macbook. Everything got fine before with the same operations. But recrently, it doesn’t work for me. Quite confused!!
Let’s continue the conversation in English so that the wider community can follow along.
I wouldn’t try installing the CLI manually, it’s probably possible, but relying on NPM to install it is the way to go.
Can you let me know what NPM registry you are using, the version of NPM you are using and also if you noticed the issue with previous versions of Forge CLI.
Hi @YY1@IssacSun , what npm registry and npm version are using? can you also try to install cloudflared manually (npm i -g cloudflared) and seeing if that works? cloudflared is a transitive dependency for the Forge CLI and we need it for tunneling, it seems like it’s not being installed.