Deployment failing in Azure App Service for React App

Annarao Kulkarni 0 Reputation points
2024-09-19T17:33:23.9566667+00:00
2024-09-19T17:06:30.379Z - Command: "/home/site/deployments/tools/deploy.sh"
2024-09-19T17:06:30.453Z - Handling node.js deployment.
2024-09-19T17:06:30.753Z - Kudu sync from: '/tmp/zipdeploy/extracted' to: '/home/site/wwwroot'
2024-09-19T17:06:30.844Z - Ignoring: .deployment
2024-09-19T17:06:30.848Z - Ignoring: .deployment
2024-09-19T17:06:31.217Z - /opt/Kudu/Scripts/selectNodeVersion.js:166
2024-09-19T17:06:31.226Z -     throw new Error('Unable to locate node.js installation directory at ' + nodejsDir);
2024-09-19T17:06:31.230Z -     ^
2024-09-19T17:06:31.244Z - Error: Unable to locate node.js installation directory at /opt/nodejs
2024-09-19T17:06:31.249Z -     at Object.<anonymous> (/opt/Kudu/Scripts/selectNodeVersion.js:166:11)
2024-09-19T17:06:31.254Z -     at Module._compile (node:internal/modules/cjs/loader:1256:14)
2024-09-19T17:06:31.260Z - An error has occurred during web site deployment.
2024-09-19T17:06:31.265Z -     at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
2024-09-19T17:06:31.267Z - select node version failed
2024-09-19T17:06:31.269Z -     at Module.load (node:internal/modules/cjs/loader:1119:32)
2024-09-19T17:06:31.275Z -     at Module._load (node:internal/modules/cjs/loader:960:12)
2024-09-19T17:06:31.278Z -     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
2024-09-19T17:06:31.281Z -     at node:internal/main/run_main_module:23:47
2024-09-19T17:06:31.286Z - Node.js v18.17.1
2024-09-19T17:06:31.304Z - /opt/Kudu/Scripts/selectNodeVersion.js:166\n    throw new Error('Unable to locate node.js installation directory at ' + nodejsDir);\n    ^\n\nError: Unable to locate node.js installation directory at /opt/nodejs\n    at Object.<anonymous> (/opt/Kudu/Scripts/selectNodeVersion.js:166:11)\n    at Module._compile (node:internal/modules/cjs/loader:1256:14)\n    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)\n    at Module.load (node:internal/modules/cjs/loader:1119:32)\n    at Module._load (node:internal/modules/cjs/loader:960:12)\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)\n    at node:internal/main/run_main_module:23:47\n\nNode.js v18.17.1\n/opt/Kudu/Scripts/starter.sh "/home/site/deployments/tools/deploy.sh"
2024-09-19T17:06:31.595Z - Deployment Failed. deployer = ms-azuretools-vscode deploymentPath = ZipDeploy. Extract zip.
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,913 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 66,706 Reputation points
    2024-09-19T18:20:01.4366667+00:00

    it appears you did not configure the node version for the app service. see:

    https://learn.microsoft.com/en-us/azure/app-service/configure-language-nodejs?pivots=platform-linux


  2. ajkuma 26,721 Reputation points Microsoft Employee
    2024-09-30T09:07:49.53+00:00

    Annarao Kulkarni, Thanks for the follow-up.

    Just to clarify, is this running locally? Please validate with your dev local environment
    If you haven't done, could you please share additional log info

    Just to highlight, when using GitHub Actions, Azure Pipelines or ZipDeploy, Oryx is not enabled by default since you are using an External builder. Yoy may enable App Service Build Service (Oryx), add a new App Setting SCM_DO_BUILD_DURING_DEPLOYMENT= true and redeploy. As outlined in this doc.

    One possible reason for the error - The zip file received by deployment engine was corrupt because of the stream timed out. This happened as Kudu site took some time to spin up and enough time was not left to download the complete zip. You may validate files are located in zip file and redeploy. Validate also zip file size, limit is 2048 MB

    Enable and review logs to fetch more details about the error.

    Kindly let us know, we will follow-up with you further.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.