twilio / twilio-cli

Unleash the power of Twilio from your command prompt
MIT License
161 stars 79 forks source link

Spawn UNKNOWN error from Twilio serverless:start --ngrok #559

Closed jassent closed 8 months ago

jassent commented 10 months ago

Need some help trying to use the Twilio CLI and Ngrok together. How do I resolve the spawn UNKNOWN issue?

Either of these commands executes with an error:

twilio serverless:start --ngrok=validpaidsubdomain
twilio serverless:start --ngrok=""

The error says:

ERROR

spawn UNKNOWN

The version of the twilio-cli according to "twilio --version" is:

twilio-cli/5.16.1

win32-x64 node-v18.18.2

I have also tried this command which results in the same spawn UNKNOWN error:

twilio serverless:start --ngrok=validpaidsubdomain.ngrok.io

This command executes successfully, starts the function, and starts Ngrok:

npx twilio-run --ngrok=validpaidsubdomain 

The version of twilio-run according to "npx twilio-run --version" is 3.5.3.

When I first start ngrok using this command:

ngrok http 3000 --domain=validpaidsubdomain.ngrok.io

I can then successfully start the function using twilio serverless:start but the Twilio CLI console does not show the correct URLs, it will show localhost instead of validpaidsubdomain.ngrok.io.

The debug log from (twilio serverless:start --ngrok=validpaidsubdomain -l debug) shows the following:

twilio-run:config:configLoader Load config +0ms
  twilio-run:config:configLoader Config found at K:\xxxx.twilioserverlessrc +39ms
  twilio-run:cli:config Read .env file at "K:\xxxx.env" +0ms
  twilio-run:cli:config Overriding port via command-line flag to 3000 +2ms
  twilio-run:start Determined configuration: { baseDir: 'K:xxxx', env: { ACCOUNT_SID: '[REDACTED]', AUTH_TOKEN: '[REDACTED]' }, port: 3000, detailedLogs: false, live: true, logs: true, appName: 'twilio-run', forkProcess: true, pkgJson: { name: '[REDACTED]', version: '[REDACTED]', private: '[REDACTED]', scripts: '[REDACTED]', dependencies: '[REDACTED]', devDependencies: '[REDACTED]', engines: '[REDACTED]' } } +0ms
  twilio-run:start Set environment variables as: { ACCOUNT_SID: '[REDACTED]', AUTH_TOKEN: '[REDACTED]' } +3ms
  twilio-runtime-handler:dev:server Creating Local Development Server +0ms
  twilio-runtime-handler:dev:server @twilio/runtime-handler version: 1.3.0 +0ms
  twilio-runtime-handler:dev:server Creating server with config: { baseDir: 'K:xxxx', env: { ACCOUNT_SID: '[REDACTED]', AUTH_TOKEN: '[REDACTED]', DEBUG: '[REDACTED]' }, port: 3000, url: 'http://localhost:3000', detailedLogs: false, live: true, logs: true, appName: 'twilio-run', forkProcess: true, logger: { useDebugModule: true, options: { level: -1 } }, routes: { functions: [ [Object] ], assets: [ [Object] ] }, enableDebugLogs: true } +1ms
  twilio-runtime-handler:dev:runtime Found the following functions available: { 'xxx': { path: 'K:\xxxx.protected.js' } } +0ms
  twilio-run:start Start server on port 3000 +331ms
  twilio-run:cli:config Starting ngrok tunnel +337ms

│ ERROR
│
│ spawn UNKNOWN
github-actions[bot] commented 9 months ago

This issue is stale because it has been open for 30 days with no activity. Please remove stale label or comment or this issue will be closed in 30 days.

github-actions[bot] commented 8 months ago

This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

github-actions[bot] commented 8 months ago

This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.