Skip to content
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

Allow installing Node.js version based on .nvmrc #14094

Closed
plaa opened this issue Dec 17, 2020 · 17 comments
Closed

Allow installing Node.js version based on .nvmrc #14094

plaa opened this issue Dec 17, 2020 · 17 comments
Assignees
Labels
Area: ABTT Akvelon Build Tasks Team area of work awaiting deployment Related changes are waiting for deployment to be completed enhancement stale

Comments

@plaa
Copy link

plaa commented Dec 17, 2020

Required Information

Entering this information will route you directly to the right team and expedite traction.

Question, Bug, or Feature?
Type: Feature

Enter Task Name: Node.js Tool Installer

Environment

  • Server - Azure Pipelines
  • Agent - Hosted

Issue Description

Please add an option to install the Node.js version defined in .nvmrc. This would be useful for fixing a particular version across development and build pipelines. Currently when the Node version is upgraded, you need to go through all pipelines and update their configuration (and impossible if different branches require different versions). For example App Center has the option of selecting a specific Node version or using .nvmrc.

@damccorm damccorm added Area: ABTT Akvelon Build Tasks Team area of work and removed route labels Jan 5, 2021
@github-actions
Copy link

github-actions bot commented Jul 4, 2021

This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days

@github-actions github-actions bot added the stale label Jul 4, 2021
@plaa
Copy link
Author

plaa commented Jul 4, 2021 via email

@github-actions github-actions bot removed the stale label Jul 4, 2021
@betopompolo
Copy link

up

@fowl2
Copy link

fowl2 commented Dec 17, 2021

I had a go at this in PR #15615

@anatolybolshakov
Copy link
Contributor

@plaa @fowl2 thanks for reporting and contribution! We are currently working on more prioritized items at the moment, but will get back to this one once be able to.

@SvetlanaMaliugina SvetlanaMaliugina self-assigned this May 30, 2022
@SvetlanaMaliugina SvetlanaMaliugina removed their assignment Jul 15, 2022
@ismayilov-ismayil ismayilov-ismayil self-assigned this Aug 31, 2022
@ismayilov-ismayil ismayilov-ismayil added the awaiting deployment Related changes are waiting for deployment to be completed label Sep 22, 2022
@JaydenMaalouf
Copy link

Is there any timeline on this deployment?
It would be awesome to have!

@github-actions
Copy link

This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days

@github-actions github-actions bot added the stale label Apr 16, 2023
@plaa
Copy link
Author

plaa commented Apr 16, 2023

Would still be useful.

@github-actions github-actions bot removed the stale label Apr 16, 2023
@JaydenMaalouf
Copy link

Would still be useful.

This has already been deployed and is working as expected on my end!

@dinbtechit
Copy link

dinbtechit commented Jun 12, 2023

@JaydenMaalouf How did you get it working? For some reason, it does not pick up the version from .nvmrc during appcenter-post-clone.sh step.

image

.nvmrc

v16.15.1

From App Center logs:
The node version shows as 18.x
image

Even manually selecting the node version from the dropdown does not work.

@JaydenMaalouf
Copy link

JaydenMaalouf commented Jun 13, 2023

@JaydenMaalouf How did you get it working? For some reason, it does not pick up the version from .nvmrc during appcenter-post-clone.sh step.

image

.nvmrc


v16.15.1

From App Center logs:

The node version shows as 18.x

image

Even manually selecting the node version from the dropdown does not work.

Are you invoking the NodeTools@0 step before attempting to run the script?

Simply calling this before anything else (but after checkout):

- task: NodeTool@0
  inputs:
    versionSource: 'fromFile'
    versionFilePath: '.nvmrc'

Should result in your node install matching the version defined in your .nvmrc

@dinbtechit
Copy link

dinbtechit commented Jun 13, 2023

Are you invoking the NodeTools@0 step before attempting to run the script?

Simply calling before anything else (but after checkout):

  • task: NodeTool@0
    inputs:
    versionSource: 'fromFile'
    versionFilePath: '.nvmrc'
    Should result in your node install matching the version defined in your .nvmrc

How do you invoke NodeTools@0 before running the post clone script... I dont think I came across any documentation that mentions that. Are you able to point me to the App Center documentation that refers about this NodeTools@0? Thanks! 🙏

@JaydenMaalouf
Copy link

Are you invoking the NodeTools@0 step before attempting to run the script?

Simply calling before anything else (but after checkout):

  • task: NodeTool@0

inputs:

versionSource: 'fromFile'

versionFilePath: '.nvmrc'

Should result in your node install matching the version defined in your .nvmrc

How do you invoke NodeTools@0 before running the post clone script... I dont think I came across any documentation that mentions that. Are you able to point me to the App Center documentation that refers about this NodeTools@0? Thanks! 🙏

Either via your yaml file using the yaml I provided above or if you are using Releases, via the Node task in Azure DevOps with the appropriate parameters

@LuwkasLima
Copy link

Hi folks, I would like some guidance on this. I'm trying to make it standard for my team to adopt .nvmrc to ensure consistency between all our applications and also in our CICD pipelines using ADO.

We have implemented Node version enforcement for Web App Service deployments successfully using .nvmrc but I'm not able to do the same with AzureStaticWebApp@0. I do not want them to maintain .nvmrc and package.json configuration.

I've tried the workaround proposed above, adding NodeTool@0 prior to AzureStaticWebApp@0, but it ignores the installation of node v18 and uses v16 to build the Next static application.
image

image

AzureStaticWebApp@0 deployment log:
image

@JaydenMaalouf
Copy link

Hi folks, I would like some guidance on this. I'm trying to make it standard for my team to adopt .nvmrc to ensure consistency between all our applications and also in our CICD pipelines using ADO.

We have implemented Node version enforcement for Web App Service deployments successfully using .nvmrc but I'm not able to do the same with AzureStaticWebApp@0. I do not want them to maintain .nvmrc and package.json configuration.

I've tried the workaround proposed above, adding NodeTool@0 prior to AzureStaticWebApp@0, but it ignores the installation of node v18 and uses v16 to build the Next static application.

image image

AzureStaticWebApp@0 deployment log:

image

That sounds like your engine version is being specified in your package.json

Make sure to update that to match your nvmrc specification

"engines": {
    "node": ">=18.0.0"
}

Copy link

This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: ABTT Akvelon Build Tasks Team area of work awaiting deployment Related changes are waiting for deployment to be completed enhancement stale
Projects
None yet
Development

No branches or pull requests

10 participants