-
Notifications
You must be signed in to change notification settings - Fork 428
Cannot update nodejs runtime version in buildspec.yml for code pipeline? #5222
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
Comments
Hello @lominming. It seems like for runtime-versions:
nodejs: 16
commands:
- n 18 |
@iamhopaul123 Do I add it at line 10 in the Doesn't seem to work. It somehow complained that it needs Docker 20 when I add the line. I will double check again, just making sure where I should put |
Here's my full example # Buildspec runs in the build stage of your pipeline.
version: 0.2
phases:
install:
runtime-versions:
ruby: 3.1
nodejs: 16
commands:
- n 18
- echo "node -v"
- echo "cd into $CODEBUILD_SRC_DIR"
- cd $CODEBUILD_SRC_DIR
# Download the copilot linux binary.
- wget -q https://ecs-cli-v2-release.s3.amazonaws.com/copilot-linux-v1.29.1 -O copilot-linux
- chmod +x ./copilot-linux
build:
commands:
- echo "Run your tests"
# - make test |
@iamhopaul123 It doesn't appear to work. I added it in the commands like you have with Steps I took:
|
Hello @lominming. Can you post your buildspec here? I use the buildspec below and in the log it shows node 18 # Buildspec runs in the build stage of your pipeline.
version: 0.2
phases:
install:
runtime-versions:
ruby: 3.1
nodejs: 16
commands:
- n 18
- node -v |
|
That's very interesting. This is what I got:
|
Hello @lominming. So sorry about the confusion. Actually mine didn't work either because apparently according to aws/aws-codebuild-docker-images#580, I am able to work it around by using phases:
install:
runtime-versions:
nodejs: 18 |
This issue is stale because it has been open 60 days with no response activity. Remove the stale label, add a comment, or this will be closed in 14 days. |
This issue is closed due to inactivity. Feel free to reopen the issue if you have any further questions! |
I've a codepipeline setup: code from github >>> test env >>> run tests >>> prod env.
I also have tests to run which depends on the host nodejs version.
I am trying to change the nodejs version in

buildspec.yml
:But it throws this error:

My tests commands are in

pipelines/.../manifest.yml
:Question 1: How can I update the nodejs version for my build pipeline?
Question 2: Can I just install a higher version of nodejs runtime at the test_commands section? Like
apk add...
The text was updated successfully, but these errors were encountered: