Deploying the websocket demo

This is the websocket demo here – WebSockets and Fly · Fly

In the command line, I type flyctl launch, and it always returns this error:

Step 5/8 : RUN npm install --production
 ---> Running in c288d9861776
npm ERR! code ENETUNREACH
npm ERR! syscall connect
npm ERR! errno ENETUNREACH
npm ERR! request to https://registry.npmjs.org/ws/-/ws-7.3.0.tgz failed, reason: connect ENETUNREACH 2606:4700::6810:1423:443

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-11-15T03_13_02_930Z-debug.log
Error error building: error rendering build status stream: The command '/bin/sh -c npm install --production' returned a non-zero code: 1

However, when I deploy the demo Build, Deploy and Run a Node Application , it works fine

I figured this out. The chat demo has a Docketfile, and the node demo has

[build]
  builder = "heroku/buildpacks:20"

in the fly.toml file.

I got rid of Dockerfile, and added the above to the chat room demo

1 Like