Skip to content

Commit 459c8aa

Browse files
committed
fix(ci): use npm config get prefix for reliable npm dir detection
1 parent 3537421 commit 459c8aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/provenance.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ jobs:
169169
- name: Upgrade npm for trusted publishing
170170
run: |
171171
# Avoid npm self-upgrade (corrupts deps mid-install on Node 22).
172-
NPM_PREFIX="$(node -p 'process.config.variables.node_prefix')"
173-
curl -sL https://registry.npmjs.org/npm/-/npm-11.12.1.tgz | tar xz -C "$NPM_PREFIX/lib/node_modules/npm" --strip-components=1
172+
NPM_DIR="$(npm config get prefix)/lib/node_modules/npm"
173+
curl -sL https://registry.npmjs.org/npm/-/npm-11.12.1.tgz | tar xz -C "$NPM_DIR" --strip-components=1
174174
echo "npm version: $(npm --version)"
175175
176176
# Get versions for lock-stepped and independent packages.

0 commit comments

Comments
 (0)