Skip to content

Commit

Permalink
Update Node.js version used in CI and use nvm
Browse files Browse the repository at this point in the history
Add a `.nvmrc` file with the currently used Node.js version to help
devs ensure they're using the correct version. Also use this in
the CI jobs to reduce the number of places we configure the version,
avoiding drift.
  • Loading branch information
AlanGreene authored and tekton-robot committed Aug 11, 2023
1 parent a8901ab commit 4662c6b
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 29 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.17.0
2 changes: 1 addition & 1 deletion docs/dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ In order to run the Tekton Dashboard, please make sure the requirements in [the
You will also need the following tools in order to build the Dashboard locally and deploy it:
1. [`go`](https://golang.org/doc/install): The language the Tekton Dashboard backend is built in
1. [`git`](https://help.github.com/articles/set-up-git/): For source control
1. [Node.js & npm](https://nodejs.org/): For building and running the frontend locally. See `engines` in [package.json](../../package.json) for versions used. _Node.js 18.x is recommended_
1. [Node.js & npm](https://nodejs.org/): For building and running the frontend locally. See [`.nvmrc`](/.nvmrc) for version used, or run `nvm use`. _Node.js 18.x is recommended_
1. [`ko`](https://github.com/google/ko): For development. `ko` version v0.7.2 or higher is required for `dashboard` to work correctly
1. [`kubectl`](https://kubernetes.io/docs/tasks/tools/install-kubectl/): For interacting with your kube cluster
1. [`kustomize`](https://kubectl.docs.kubernetes.io/installation/kustomize/): For building the Dashboard manifests. v4.5.4 is known to work
Expand Down
20 changes: 10 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@
"vitest": "^0.34.1"
},
"engines": {
"node": "^18.16.0",
"npm": "^9.5.1"
"node": "^18.17.0",
"npm": "^9.6.7"
},
"//": "Workspaces must be listed explicitly to ensure they're processed in the correct order until npm natively supports detecting the topological order",
"workspaces": [
Expand Down
4 changes: 2 additions & 2 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"react-router-dom": "^5.0.0"
},
"engines": {
"node": "^18.16.0",
"npm": "^9.5.1"
"node": "^18.17.0",
"npm": "^9.6.7"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions packages/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"cypress": "^12.17.2"
},
"engines": {
"node": "^18.16.0",
"npm": "^9.5.1"
"node": "^18.17.0",
"npm": "^9.6.7"
},
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions packages/graph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"react-intl": "^6.4.1"
},
"engines": {
"node": "^18.16.0",
"npm": "^9.5.1"
"node": "^18.17.0",
"npm": "^9.6.7"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"react-router-dom": "^5.0.0"
},
"engines": {
"node": "^18.16.0",
"npm": "^9.5.1"
"node": "^18.17.0",
"npm": "^9.6.7"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion tekton/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
- name: source
steps:
- name: build-static
image: node:18.16-alpine
image: node:18.17-alpine
workingDir: $(workspaces.source.path)
env:
- name: CI
Expand Down
11 changes: 4 additions & 7 deletions test/presubmit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,10 @@ function get_node() {
echo "Installing Node.js"
apt-get update
apt-get install -y curl
curl -O https://nodejs.org/dist/v18.16.0/node-v18.16.0-linux-x64.tar.xz
tar xf node-v18.16.0-linux-x64.tar.xz
export PATH=$PATH:$(pwd)/node-v18.16.0-linux-x64/bin
echo ">> Node.js version"
node --version
echo ">> npm version"
npm --version
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash
export NVM_DIR="$HOME/.nvm"
source "$NVM_DIR/nvm.sh"
nvm install
}

function node_npm_install() {
Expand Down

0 comments on commit 4662c6b

Please sign in to comment.