File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22
3+ AMPLIFY_NODE_VERSION=18.20.4
4+
35# set exit on error to true
46set -e
57
@@ -131,6 +133,7 @@ function _setShell {
131133
132134function _buildLinux {
133135 _setShell
136+ _setupNodeVersion $AMPLIFY_NODE_VERSION
134137 echo " Linux Build"
135138 yarn run production-build
136139 storeCacheForLinuxBuildJob
@@ -512,4 +515,25 @@ function _emitRegionalizedCanaryMetric {
512515 --value $CODEBUILD_BUILD_SUCCEEDING \
513516 --dimensions branch=release,region=$CLI_REGION \
514517 --region us-west-2
518+ }
519+
520+ function _setupNodeVersion {
521+ local version=$1 # Version number passed as an argument
522+
523+ echo " Installing NVM and setting Node.js version to $version "
524+
525+ # Install NVM
526+ curl -o - https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
527+
528+ # Load NVM
529+ export NVM_DIR=" $HOME /.nvm"
530+ [ -s " $NVM_DIR /nvm.sh" ] && \. " $NVM_DIR /nvm.sh"
531+
532+ # Install and use the specified Node.js version
533+ nvm install " $version "
534+ nvm use " $version "
535+
536+ # Verify the Node.js version in use
537+ echo " Node.js version in use:"
538+ node -v
515539}
You can’t perform that action at this time.
0 commit comments