Azure Web App + Angular: Couldn’t detect a version for the platform ‘nodejs’ in the repo

theartemkovtun
2 min readJun 3, 2023

--

Intro

Hi all, this will be a short one.

Recently I was trying to deploy my Angular application to Azure Web App and faced a problem while publishing from VS Code.

Problem

The app was running locally with no problems, but the deployment outputted next:

....
<time> <app-name>: Detecting platforms…
<time> <app-name>: Could not detect any platform in the source directory.
<time> <app-name>: Error: Couldn't detect a version for the platform 'nodejs'
in the repo.
<time> <app-name>: /bin/bash -c "oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot - platform nodejs - platform-version 16 -p virtualenv_name= - log-file /tmp/build-debug.log -i /tmp/8db644f4a59638f -p compress_node_modules=tar-gz | tee /tmp/oryx-build.log ; exit $PIPESTATUS "
<time> <app-name>: Generating summary of Oryx build
....

Solution

  1. Open Web App on Azure Portal
  2. Navigate to the Configuration section

3. Add new Application Settings record

SCM_DO_BUILD_DURING_DEPLOYMENT=false

4. Open General settings tab

5. Set Startup Command

pm2 serve /home/site/wwwroot --no-daemon --spa

6. Redeploy the app

Conclusion

Completion of all these steps should fix the problem described. At least it happened in my case.

If you are still facing problems even after setting all the required application settings and the startup command — feel free to contact me.

--

--