Error: Platform 'php' version '8.0' is unsupported for node app
antjw001 opened this issue · 2 comments
Bug Report
-
At what date and time did you most recently experience the problem?
-
2nd April 2024
-
Where did you experience the problem? E.g. Azure Web Apps, Azure Functions, Azure Container Registry, or offline use.
Deploying to Azure app service -
If your repo is publicly available please share its URL:
-
What happened?
I have a typescript nodejs app. When deploy from vscode or the deployment center it fails because it does not support python v8, though this is not a python app. -
What did you expect or want to happen?
-That it deploys. It did deploy previously and nothing has changed to the setup. There are simply a few code changes that are not significant.
I have seen a previous post that seems to say that oryx search node_modules and finds php code in there and so detects php incorrectly. Is this the problem and if so what can i do?
-
How can we reproduce it?
-
Do you have log output? Please include between the backticks:
8:59:53 PM linq-demo-alpha: Fetching changes.
8:59:54 PM linq-demo-alpha: Cleaning up temp folders from previous zip deployments and extracting pushed zip file /tmp/zipdeploy/252c2d52-b8f4-49a4-9617-541de6da3b5c.zip (23.14 MB) to /tmp/zipdeploy/extracted
9:00:08 PM linq-demo-alpha: Updating submodules.
9:00:09 PM linq-demo-alpha: Preparing deployment for commit id 'abcd263c-4'.
9:00:10 PM linq-demo-alpha: PreDeployment: context.CleanOutputPath False
9:00:10 PM linq-demo-alpha: PreDeployment: context.OutputPath /home/site/wwwroot
9:00:10 PM linq-demo-alpha: Repository path is /tmp/zipdeploy/extracted
9:00:10 PM linq-demo-alpha: Running oryx build...
9:00:10 PM linq-demo-alpha: Command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version 20 -p virtualenv_name= --log-file /tmp/build-debug.log -i /tmp/8dc52eaeb211019 -p compress_node_modules=tar-gz | tee /tmp/oryx-build.log
9:00:11 PM linq-demo-alpha: Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
9:00:11 PM linq-demo-alpha: You can report issues at https://github.com/Microsoft/Oryx/issues
9:00:11 PM linq-demo-alpha: Oryx Version: 0.2.20230829.1, Commit: 5bd3088, ReleaseTagName: 20230829.1
9:00:11 PM linq-demo-alpha: Build Operation ID: 366f8aaa339ba7db
9:00:11 PM linq-demo-alpha: Repository Commit : abcd263c-467e-459b-8f1d-debc97290efa
9:00:11 PM linq-demo-alpha: OS Type : bookworm
9:00:11 PM linq-demo-alpha: Image Type : githubactions
9:00:11 PM linq-demo-alpha: Detecting platforms...
9:00:36 PM linq-demo-alpha: Error: Platform 'php' version '8.0' is unsupported. Supported versions: 8.1.22, 8.2.16, 8.2.9, 8.3.4, 8.1.22, 8.2.16, 8.2.9, 8.3.4
9:00:37 PM linq-demo-alpha: /bin/bash -c "oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version 20 -p virtualenv_name= --log-file /tmp/build-debug.log -i /tmp/8dc52eaeb211019 -p compress_node_modules=tar-gz | tee /tmp/oryx-build.log ; exit $PIPESTATUS "
9:00:45 PM linq-demo-alpha: Deployment failed.
9:04:56 PM: Starting "linq-demo-alpha"...
9:04:57 PM: "linq-demo-alpha" has been started.
I think you are referencing my issue.😅
I solved the issue by adding a postinstall script to my package.json to delete the offending php file from the node_modules folder after install.
{
"scripts": {
...
"postinstall": "rimraf node_modules/flatted/php"
...
}
}
rimraf needs to be added to your devDependecies too.
You can search your node_modules folder for any other modules that trigger Oryx too and add them to the postinstall command.
Hope this helps!
Thanks Peter, I found a problem with the build but it wasn't showing up in the logs, it just showed the php error. But your solution is good to know for future reference.