Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

CI: install npm@latest to a separate prefix to avoid self-upgrade bug

Damian Legawiecc4fd68b93059
diff --git a/.github/workflows/docs-package.yml b/.github/workflows/docs-package.yml
index 0285b2e645..05cd1aa427 100644
--- a/.github/workflows/docs-package.yml
+++ b/.github/workflows/docs-package.yml
@@ -74,8 +74,15 @@ jobs:
- run: pnpm install --frozen-lockfile
working-directory: .
+ # Trusted Publishing requires npm >= 11.5.1, but the bundled npm
+ # on Node 22 is 10.9.7. A plain `npm install -g npm@latest` swaps
+ # npm's own files in place and the in-flight install can't find
+ # its own dependencies (MODULE_NOT_FOUND: promise-retry). Install
+ # to a separate prefix and prepend to PATH instead.
- name: Upgrade npm for Trusted Publishing support
- run: npm install -g npm@latest
+ run: |
+ npm install -g npm@latest --prefix="$HOME/.npm-global"
+ echo "$HOME/.npm-global/bin" >> "$GITHUB_PATH"
working-directory: .
- name: Bump version above published
diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml
index b34a3992a1..aac08ccb10 100644
--- a/.github/workflows/packages.yml
+++ b/.github/workflows/packages.yml
@@ -185,8 +185,15 @@ jobs:
- run: pnpm install --frozen-lockfile
working-directory: .
+ # Trusted Publishing requires npm >= 11.5.1, but the bundled npm
+ # on Node 22 is 10.9.7. A plain `npm install -g npm@latest` swaps
+ # npm's own files in place and the in-flight install can't find
+ # its own dependencies (MODULE_NOT_FOUND: promise-retry). Install
+ # to a separate prefix and prepend to PATH instead.
- name: Upgrade npm for Trusted Publishing support
- run: npm install -g npm@latest
+ run: |
+ npm install -g npm@latest --prefix="$HOME/.npm-global"
+ echo "$HOME/.npm-global/bin" >> "$GITHUB_PATH"
working-directory: .
- name: Check if version is published
@@ -229,8 +236,15 @@ jobs:
- run: pnpm install --frozen-lockfile
working-directory: .
+ # Trusted Publishing requires npm >= 11.5.1, but the bundled npm
+ # on Node 22 is 10.9.7. A plain `npm install -g npm@latest` swaps
+ # npm's own files in place and the in-flight install can't find
+ # its own dependencies (MODULE_NOT_FOUND: promise-retry). Install
+ # to a separate prefix and prepend to PATH instead.
- name: Upgrade npm for Trusted Publishing support
- run: npm install -g npm@latest
+ run: |
+ npm install -g npm@latest --prefix="$HOME/.npm-global"
+ echo "$HOME/.npm-global/bin" >> "$GITHUB_PATH"
working-directory: .
- name: Check if version is published
@@ -287,8 +301,15 @@ jobs:
- run: pnpm install --frozen-lockfile
working-directory: .
+ # Trusted Publishing requires npm >= 11.5.1, but the bundled npm
+ # on Node 22 is 10.9.7. A plain `npm install -g npm@latest` swaps
+ # npm's own files in place and the in-flight install can't find
+ # its own dependencies (MODULE_NOT_FOUND: promise-retry). Install
+ # to a separate prefix and prepend to PATH instead.
- name: Upgrade npm for Trusted Publishing support
- run: npm install -g npm@latest
+ run: |
+ npm install -g npm@latest --prefix="$HOME/.npm-global"
+ echo "$HOME/.npm-global/bin" >> "$GITHUB_PATH"
working-directory: .
- name: Check if version is published
@@ -341,8 +362,15 @@ jobs:
- run: pnpm install --frozen-lockfile
working-directory: .
+ # Trusted Publishing requires npm >= 11.5.1, but the bundled npm
+ # on Node 22 is 10.9.7. A plain `npm install -g npm@latest` swaps
+ # npm's own files in place and the in-flight install can't find
+ # its own dependencies (MODULE_NOT_FOUND: promise-retry). Install
+ # to a separate prefix and prepend to PATH instead.
- name: Upgrade npm for Trusted Publishing support
- run: npm install -g npm@latest
+ run: |
+ npm install -g npm@latest --prefix="$HOME/.npm-global"
+ echo "$HOME/.npm-global/bin" >> "$GITHUB_PATH"
working-directory: .
- name: Check if version is published