From 3b4c7db24e36f29a084509005ac1075b7b14dc49 Mon Sep 17 00:00:00 2001 From: Rifa Achrinza <25147899+achrinza@users.noreply.github.com> Date: Thu, 25 Nov 2021 17:59:38 +0800 Subject: [PATCH] ci: pin NPM version see: https://github.com/loopbackio/cicd/issues/6 Signed-off-by: Rifa Achrinza <25147899+achrinza@users.noreply.github.com> --- .github/workflows/ci.yaml | 6 +++++- .travis.yml | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index dbea9e2..80ba55a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -31,8 +31,12 @@ jobs: uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} + - name: Update NPM (Node.js v10) + if: matrix.node-version == 10 + run: npm install --global npm@7 - name: Update NPM - run: npm install -g npm + if: matrix.node-version != 10 + run: npm install --global npm@8 - name: Bootstrap project run: npm ci --ignore-scripts - name: Run tests diff --git a/.travis.yml b/.travis.yml index bd5ae4a..1817255 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,14 @@ arch: branches: only: master language: node_js -before_install: npm install --global npm +before_install: | + NODEJS_VERSION=$(node --version) + if [ 'v10' == ${NODEJS_VERSION%%.*} ] + then + npm install --global npm@7 + else + npm install --global npm@8 + fi install: npm ci --ignore-scripts script: npm test --ignore-scripts node_js: