From 133edc94ae8d96eed56f7738efc4f18477f4d355 Mon Sep 17 00:00:00 2001 From: Peter Ashwood Date: Thu, 28 May 2026 13:23:16 +0000 Subject: [PATCH 1/2] fix(setup-node): cannot install npm into system folder --- setup-node/action.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/setup-node/action.yml b/setup-node/action.yml index 995f8c9..8b51fc1 100644 --- a/setup-node/action.yml +++ b/setup-node/action.yml @@ -16,7 +16,7 @@ inputs: working-directory: description: 'The working directory of setup' default: '.' - install: + install: description: 'Whether or not to run npm ci' default: 'true' @@ -32,7 +32,11 @@ runs: package-manager-cache: false - run: | - npx npm -g i npm@${{ inputs.npm-version }} + npx npm config set prefix "${HOME}/.npm-global" + npx npm install -g npm@${{ inputs.npm-version }} + echo "${HOME}/.npm-global/bin" >> $GITHUB_PATH + echo "npm_version=$(${HOME}/.npm-global/bin/npm -v)" >> ${GITHUB_OUTPUT} + working-directory: ${{ inputs.working-directory }} shell: bash if: inputs.npm-version != '' From fd2d7bd9e515154085fd8fb955a8f72e6f97d23b Mon Sep 17 00:00:00 2001 From: Peter Ashwood Date: Fri, 29 May 2026 18:23:32 +0000 Subject: [PATCH 2/2] update --- setup-node/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup-node/action.yml b/setup-node/action.yml index 8b51fc1..fb1e1ad 100644 --- a/setup-node/action.yml +++ b/setup-node/action.yml @@ -35,14 +35,14 @@ runs: npx npm config set prefix "${HOME}/.npm-global" npx npm install -g npm@${{ inputs.npm-version }} echo "${HOME}/.npm-global/bin" >> $GITHUB_PATH - echo "npm_version=$(${HOME}/.npm-global/bin/npm -v)" >> ${GITHUB_OUTPUT} working-directory: ${{ inputs.working-directory }} shell: bash if: inputs.npm-version != '' + name: Upgrade npm - run: echo "npm_version=$(npm -v)" >> ${GITHUB_OUTPUT} shell: bash - name: Upgrade npm + name: Get npm version id: get-npm-version - name: Get npm cache directory