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

chore: Update .gitpod to use correct Node version #37336

Merged
merged 4 commits into from
Jan 5, 2023

Conversation

markacola
Copy link
Contributor

@markacola markacola commented Dec 26, 2022

Description

Update Gitpod to use node version 18.

Added commands according to Gitpod documentation, except updated bash var to NODE_VERSION instead of the more generic VERSION suggested.

Documentation

N/A - this just allows the current gitpod config to run correctly.

Related Issues

N/A - I haven't created any separate issues for this.

Currently, opening the repo in Gitpod, or locally as a container in VSCode, yields the following error:

yarn run v1.21.0
error @: The engine "node" is incompatible with this module. Expected version ">=18.0.0". Got "16.13.0"
error Commands cannot run with an incompatible environment.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this **command.**

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Dec 26, 2022
@LekoArts LekoArts added topic: automation Related to Circle CI, Peril, Renovate, scripts/*, Github Workflows, Github Actions, or Slackbot and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jan 3, 2023
@LekoArts
Copy link
Contributor

LekoArts commented Jan 3, 2023

Hi, thanks for the PR!

The repository already contains a .nvmrc file so in theory the script could just call nvm use, correct?

@markacola
Copy link
Contributor Author

markacola commented Jan 4, 2023

Unfortunately, without the explicit installation, that results in:

Found '/workspaces/gatsby/.nvmrc' with version <18>
N/A: version "18 -> N/A" is not yet installed.

You need to run "nvm install 18" to install it before using it.

I will update the Dockerfile to bring in the .nvmrc file when building the image, update the command to just nvm install, and update to nvm use at runtime.

I've confirmed this is working as expected locally using the VSCode Devcontainer feature.
Would it be worth including the generated .devcontainer/devcontainer.json config file as well for other VSCode contributors?

{
  "name": "Existing Dockerfile",
  "build": {
    "context": "..",
    "dockerfile": "../.gitpod.Dockerfile"
  }
}

@LekoArts LekoArts changed the title fix: update gitpod to use node version 18 chore: Update .gitpod to use correct Node version Jan 5, 2023
Copy link
Contributor

@LekoArts LekoArts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR as-is looks good to me.

I think the dev container thingy is a separate discussion. From my testing with GitHub codespaces the repository just worked, it didn't have the niceties installed like the gitpod version though.

I'm open for adding a devcontainer config (https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/setting-up-your-project-for-codespaces) but let's do that in another PR :)

@LekoArts LekoArts merged commit 04fb852 into gatsbyjs:master Jan 5, 2023
@markacola markacola deleted the fix/gitpod-node-version-bump branch January 6, 2023 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: automation Related to Circle CI, Peril, Renovate, scripts/*, Github Workflows, Github Actions, or Slackbot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants