wasp deploy fly deploy fail
#14 259.7 npm notice
#14 259.7 npm ERR! code ERR_SOCKET_TIMEOUT
#14 259.7 npm ERR! network Socket timeout
#14 259.7 npm ERR! network
#14 259.7 npm ERR! network If you are behind a proxy, please make sure that
#14 259.7 npm ERR! A complete log of this run can be found in:
#14 ERROR: process "/bin/sh -c npm install && cd .wasp/build/server && npm install" did not complete successfully: exit code: 1
------
[server-builder 8/11] RUN npm install && cd .wasp/build/server && npm install:259.7 npm notice 259.7 npm ERR! code ERR_SOCKET_TIMEOUT 259.7 npm ERR! network Socket timeout 259.7 npm ERR! network This is a problem related to network connectivity. 259.7 npm ERR! network In most cases you are behind a proxy or have bad network settings. 259.7 npm ERR! network 259.7 npm ERR! network If you are behind a proxy, please make sure that the 259.7 npm ERR! network 'proxy' config is set properly. See: 'npm help config' 259.7 259.7 npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2025-09-24T02_56_41_146Z-debug-0.log ------ Error: failed to fetch an image or build from source: error building: failed to solve: process "/bin/sh -c npm install && cd .wasp/build/server && npm install" did not complete successfully: exit code: 1 at ChildProcess.<anonymous> (/Users/rakesh/.local/share/wasp-lang/0.16.7/data/packages/deploy/node_modules/zx/build/vendor-core.cjs:502:16) at Object.onceWrapper (node:events:634:26) at ChildProcess.emit (node:events:519:28) at maybeClose (node:internal/child_process:1101:16) at ChildProcess._handle.onexit (node:internal/child_process:304:5) at Process.callbackTrampoline (node:internal/async_hooks:130:17) { _code: [Getter], _signal: [Getter], _stdout: [Getter], _stderr: [Getter], _combined: [Getter], _duration: [Getter] } Node.js v22.19.0 ❌ --- [Error] Deploy command failed: - Deploy command failed with exit code: 1
9 Replies
Hi @Mrr. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Your deployment error with wasp deploy fly deploy—specifically npm ERR! code ERR_SOCKET_TIMEOUT and network Socket timeout—indicates a network connectivity issue during the npm install step inside the Fly.io build process. This is not specific to Wasp, but rather a common npm/network problem, often caused by:
- Slow or unstable internet connection on the build server.
- Network restrictions, firewalls, or proxies blocking npm registry access.
- Temporary npm registry outages.
Relevant discussions in the Wasp community have seen similar npm install failures due to network issues, especially in environments with limited resources or unstable connections. For example, users have reported npm install failures with errors like ECONNRESET or timeouts, and the recommended steps include checking your network connection, ensuring you are not behind a restrictive proxy, and sometimes simply retrying the deployment when the network is more stable. Running wasp clean and then wasp start can help locally, but for Fly.io, the issue is usually on the remote builder's side or your own network if building locallyCant find: src/shared/constants.ts file? Stripe connect. > Answers Part 6.
If you are behind a proxy, make sure your npm config is set up correctly as suggested in the error message. If the problem persists, you can try:
- Retrying the deployment (sometimes transient network issues resolve themselves).
- Using the --build-locally option to build the Docker image on your machine instead of Fly.io’s remote builder, which can help if your local network is more reliableDeploying with the Wasp CLI > Building Locally.
- Ensuring your project and dependencies are up to date and that there are no custom npm registry settings interfering with the build.
If none of these steps resolve the issue, you may want to check Fly.io’s status or reach out to their support, as the problem could be on their infrastructure.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Mrr, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?
Not sure what's going on and if related to Wasp - maybe Fly is flaky today, maybe you have some dependency from a private registry that can't be fetched on Fly?
Does your
wasp build
command work as expected?Yess
Hey so i used wasp 0.15.0 and have no problem but yesterday i upgraded the version to 0.16.7 and fixed typescript errors and all. Build is successful and can able to run in locally but cant able to deploy. Is it because of version ? Do i have to make any changes in fly? @miho
I'd suggest running
wasp clean
and wasp build
to be sure everything is okay locally.
If wasp build
passes - Fly deployment should work fine because it just calling Fly CLI in the background which did not change the way it works, so Wasp version is not affecting their CLI in any way.
You are running wasp deploy fly deploy
since you already have a deployed app?wasp clean
🐝 --- Deleting the .wasp/ directory... -------------------------------------------
✅ --- Deleted the .wasp/ directory. ----------------------------------------------
🐝 --- Deleting the node_modules/ directory... ------------------------------------
✅ --- Deleted the node_modules/ directory. ---------------------------------------
Yes i am using wasp deploy fly deploy.
i did wasp deploy fly deploy @miho can you please see this.
Given that you get
ECONNRESET
I'd say that's Fly having some network issues. In which Fly region did you deploy your app?
One extra thing you can try it to use the --build-locally
flag which you pass to the wasp deploy fly deploy
so the container is built on your machine and not on Fly.Hey thanks build locally worked for me 😄