-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Oryx does not support node version 18 #2369
Comments
Same issue. Even if I specify node version in a previous task, it won't use that version. For example, this is what I have in my pipeline: - stage: Build
jobs:
- job: Build
displayName: Build & deploy
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
inputs:
versionSource: 'spec'
versionSpec: '18.x'
checkLatest: true
displayName: 'Install Node.js'
- task: AzureStaticWebApp@0
inputs:
azure_static_web_apps_api_token: $(AZURE_STATIC_WEB_APPS_TOKEN)
app_location: "/" # App source code path
output_location: "out" # Built app content directory - optional
is_static_export: true # For running Static Next.js file - optional This is the error log:
|
Specifying node version in package.json worked according to #2367 comment |
PS: I just found this note about specifying node version in package.json. It's a bit hidden:
|
Neither this |
@chryw To answer your private npm feed problem, what I've done is uploaded a .npmrc file to secure files in Azure Devops and downloaded the file to the build. You could also just add an .npmrc file yourself to your repo and make sure you have always-auth set to false. Here's the whole job template minus the input params. It can handle building an azure static web app too. jobs:
- job:
displayName: Build Application
container: 'mcr.microsoft.com/oryx/build:latest'
variables:
- name: buildPath
value: $(Build.SourcesDirectory)/${{parameters.projectDirectory}}
steps:
- checkout: self
- task: DownloadSecureFile@1
displayName: Download private .npmrc file
name: npmrc
inputs:
secureFile: 'private.npmrc'
- script: |
mv $(npmrc.secureFilePath) ${{variables.buildPath}}/.npmrc
displayName: 'Move secure file to nodejs project dir'
- script: oryx build ${{variables.buildPath}} --output $(Build.ArtifactStagingDirectory)
displayName: Build
env:
NODE_VERSION: ${{parameters.nodeVersion}}
NODE_DEFAULT_VERSION: ${{parameters.nodeDefaultVersion}}
DISABLE_NODEJS_BUILD: ${{parameters.disableNodeJsBuild}}
CUSTOM_BUILD_COMMAND: ${{parameters.customBuildCommand}}
RUN_BUILD_COMMAND: ${{parameters.runBuildCommand}}
ENABLE_NODE_MONOREPO_BUILD: ${{parameters.enabledNodeMonorepoBuild}}
COMPRESS_DESTINATION_DIR: ${{parameters.compressDestinationDir}}
PRUNE_DEV_DEPENDENCIES: ${{parameters.pruneDevDependencies}}
NPM_REGISTRY_URL: ${{parameters.npmRegistryUrl}}
YARN_TIMEOUT_CONFIG: ${{parameters.yarnTimeoutConfig}}
- ${{if eq(parameters.isSWA, true)}}:
- script: cp $(Build.SourcesDirectory)/staticwebapp.config.json $(Build.ArtifactStagingDirectory)/dist/${{parameters.outputDir}}
displayName: Copy staticwebapp.config.json to dist/${{parameters.outputDir}}
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)/dist'
artifact: 'drop'
publishLocation: 'pipeline' |
I figured out you can specify a debian flavor. Using bullseye since that supports node 18. Also specified the node version environment var too. Getting this error now
|
Possibly related? |
Thanks @bh3605 ! I ended up bypassing the build part that came with AzureStaticWebApp@0 task and just installed specific node version, run npm install and authentication separately using other tasks that usually work. Here's an example - stage: Build
jobs:
- job: Build
displayName: Build & deploy
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
inputs:
versionSource: 'spec'
versionSpec: '18.x'
checkLatest: true
displayName: 'Install Nodejs'
- task: Npm@1
inputs:
command: 'install'
displayName: 'Authenticate and install dependencies'
- task: Npm@1
inputs:
command: 'custom'
customCommand: 'run build'
displayName: 'Build and export static Next.js app'
# Note: Bypass the app build because this task doesn't support private feed authentication and specifying node version. Do these in usual NPM tasks above.
- task: AzureStaticWebApp@0
inputs:
app_location: 'out'
output_location: ''
skip_app_build: true
skip_api_build: true
is_static_export: true
azure_static_web_apps_api_token: '$(AZURE_STATIC_WEB_APPS_TOKEN)'
displayName: 'Deploy to Azure static website' |
@chryw That's a neat trick. I'll remember that! |
Bug Report
At what date and time did you most recently experience the problem?
2/29/24
Where did you experience the problem? E.g. Azure Web Apps, Azure Functions, Azure Container Registry, or offline use.
Azure Devops
If your repo is publicly available please share its URL:
What happened?
Oryx says it does not support a version of nodejs it does in fact support.
What did you expect or want to happen?
Build succeeded
How can we reproduce it?
build an angular 17 app
Do you have log output? Please include between the backticks:
Starting: Build
==============================================================================
Task : Command line
Description : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
Version : 2.231.1
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
==============================================================================
##[warning]The container operating system doesn't support Node20. Using Node16 instead. Please upgrade the operating system of the container to remain compatible with future updates of tasks: https://github.com/nodesource/distributions
Generating script.
Script contents:
oryx build /__w/1/s/ --output /__w/1/a
========================== Starting Command Output ===========================
/bin/bash --noprofile --norc /__w/_temp/ca0f06c8-dc3d-4b96-a2cd-f5f94cc643d8.sh
Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
You can report issues at https://github.com/Microsoft/Oryx/issues
Oryx Version: 0.2.20240222.1, Commit: 8b3ac45, ReleaseTagName: 20240222.1
Build Operation ID: 88e13cde3c3cae6b
Repository Commit : 6c7b4684f5790d79f4e5949183f6dbd56444a65f
OS Type : stretch
Image Type : full
Detecting platforms...
Error: Platform 'nodejs' version '>=18.13.0' is unsupported. Supported versions: 10.1.0, 10.10.0, 10.12.0, 10.14.2, 10.16.3, 10.18.0, 10.18.1, 10.19.0, 10.20.0, 10.20.1, 10.21.0, 10.22.0, 10.22.1, 10.23.0, 10.24.1, 12.11.0, 12.11.1, 12.12.0, 12.13.0, 12.14.0, 12.14.1, 12.16.0, 12.16.1, 12.16.2, 12.16.3, 12.18.0, 12.18.1, 12.18.2, 12.18.3, 12.18.4, 12.19.0, 12.20.0, 12.21.0, 12.22.0, 12.22.11, 12.22.12, 12.22.4, 12.22.6, 12.22.9, 12.9.1, 13.9.0, 14.0.0, 14.1.0, 14.10.0, 14.10.1, 14.11.0, 14.12.0, 14.13.0, 14.13.1, 14.14.0, 14.15.0, 14.15.1, 14.16.0, 14.17.0, 14.17.4, 14.17.6, 14.18.3, 14.19.1, 14.2.0, 14.21.3, 14.3.0, 14.4.0, 14.5.0, 14.6.0, 14.7.0, 14.8.0, 14.9.0, 15.0.0, 15.0.1, 15.1.0, 15.2.0, 15.2.1, 15.3.0, 16.13.1, 16.13.2, 16.14.0, 16.14.2, 16.20.0, 16.5.0, 16.6.1, 16.8.0, 17.0.1, 17.1.0, 17.2.0, 17.3.1, 17.4.0, 17.5.0, 17.6.0, 4.4.7, 4.5.0, 4.8.0, 4.8.7, 4.9.0, 4.9.1, 6.10.3, 6.11.0, 6.11.5, 6.17.1, 6.2.2, 6.6.0, 6.9.3, 6.9.5, 8.0.0, 8.1.4, 8.11.2, 8.11.4, 8.12.0, 8.15.1, 8.16.1, 8.16.2, 8.17.0, 8.2.1, 8.8.1, 8.9.4, 9.4.0, 1.17.3, 1.18.0, 1.19.0, 1.19.1, 1.19.2, 1.20.0, 1.21.0, 1.21.1, 1.22.0, 1.22.1, 1.22.2, 1.22.4, 10.1.0, 10.10.0, 10.12.0, 10.14.2, 10.16.3, 10.18.0, 10.18.1, 10.19.0, 10.20.0, 10.20.1, 10.21.0, 10.22.0, 10.22.1, 10.23.0, 10.24.1, 12.11.0, 12.11.1, 12.12.0, 12.13.0, 12.14.0, 12.14.1, 12.16.0, 12.16.1, 12.16.2, 12.16.3, 12.18.0, 12.18.1, 12.18.2, 12.18.3, 12.18.4, 12.19.0, 12.20.0, 12.21.0, 12.22.0, 12.22.11, 12.22.12, 12.22.4, 12.22.6, 12.22.9, 12.9.1, 13.9.0, 14.0.0, 14.1.0, 14.10.0, 14.10.1, 14.11.0, 14.12.0, 14.13.0, 14.13.1, 14.14.0, 14.15.0, 14.15.1, 14.16.0, 14.17.0, 14.17.4, 14.17.6, 14.18.3, 14.19.1, 14.2.0, 14.21.3, 14.3.0, 14.4.0, 14.5.0, 14.6.0, 14.7.0, 14.8.0, 14.9.0, 15.0.0, 15.0.1, 15.1.0, 15.2.0, 15.2.1, 15.3.0, 16.13.1, 16.13.2, 16.14.0, 16.14.2, 16.20.0, 16.5.0, 16.6.1, 16.8.0, 17.0.1, 17.1.0, 17.2.0, 17.3.1, 17.4.0, 17.5.0, 17.6.0, 4.4.7, 4.5.0, 4.8.0, 4.8.7, 4.9.0, 4.9.1, 6.10.3, 6.11.0, 6.11.5, 6.17.1, 6.2.2, 6.6.0, 6.9.3, 6.9.5, 8.0.0, 8.1.4, 8.11.2, 8.11.4, 8.12.0, 8.15.1, 8.16.1, 8.16.2, 8.17.0, 8.2.1, 8.8.1, 8.9.4, 9.4.0, 1.17.3, 1.18.0, 1.19.0, 1.19.1, 1.19.2, 1.20.0, 1.21.0, 1.21.1, 1.22.0, 1.22.1, 1.22.2, 1.22.4
##[error]Bash exited with code '3'.
The text was updated successfully, but these errors were encountered: