Skip to content

Commit 5e09bfc

Browse files
publish: use npx npm@11 to bypass PATH-shadowing for npm publish (#179)
`npm install -g npm@latest` installs into a path that the GitHub runner doesn't put first in PATH, so subsequent `npm publish` still runs the Node-bundled npm 10.x. OIDC trusted publishing requires npm >= 11.5.1, so we ENEEDAUTH'd silently. Fix: invoke npm via `npx -y npm@11 publish --access public`. npx bypasses PATH and runs the exact pinned version. Also echo node + npm versions for future diagnosis. v3.8.3 PyPI shipped fine; npm failed with this exact ENEEDAUTH and was yanked manually.
1 parent 392f468 commit 5e09bfc

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

.github/workflows/publish.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,16 @@ jobs:
223223
working-directory: browser-use-node
224224
run: pnpm build
225225

226-
- name: Upgrade npm to OIDC-capable version
227-
run: npm install -g npm@latest
228-
229226
- name: Publish to npm (OIDC trusted publishing)
230227
working-directory: browser-use-node
231-
run: npm publish --access public
228+
run: |
229+
set -euo pipefail
230+
# Node 22 ships with npm 10.x; OIDC trusted publishing requires
231+
# npm >= 11.5.1. `npm install -g npm@latest` on the GitHub runner
232+
# puts the new binary on a PATH that doesn't shadow the bundled
233+
# npm, so `npm publish` still picks up the old 10.x. Bypass by
234+
# invoking the version explicitly via npx.
235+
NPM_VERSION="11"
236+
echo "Node: $(node --version)"
237+
echo "npm: $(npx -y npm@${NPM_VERSION} --version)"
238+
npx -y npm@${NPM_VERSION} publish --access public

0 commit comments

Comments
 (0)