From af1a7b6de7f8764cd7527b6abf18a718b082a203 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikl=C3=B3s=20Fazekas?= Date: Fri, 8 Aug 2025 19:52:35 +0200 Subject: [PATCH] fix: Fix npm publish error by updating Node.js version in workflow The publish workflow was using Node.js 14.x which is incompatible with react-native-builder-bob's arktype dependency. This causes the ERR_REQUIRE_ESM error during npm publish. Changes: - Remove duplicate Node.js setup that was overriding the .nvmrc version - Update to actions/setup-node@v4 for better compatibility - Use yarn install instead of npm install for better module handling - Fix deprecated set-output syntax to use GITHUB_OUTPUT This fixes the "Error [ERR_REQUIRE_ESM]: Must use import to load ES Module" error that was preventing successful npm publishes. --- .github/workflows/publish.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 92ed0a60a7..f951284e0b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,20 +9,15 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Read .nvmrc - run: echo ::set-output name=NVMRC::$(cat .nvmrc) + run: echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_OUTPUT id: nvm - name: Setup node ${{ steps.nvm.outputs.NVMRC }} - uses: actions/setup-node@v3.5.1 + uses: actions/setup-node@v4 with: node-version: ${{ steps.nvm.outputs.NVMRC }} - registry-url: https://registry.npmjs.org/ - - name: Setup Node - uses: actions/setup-node@v3.5.1 - with: - node-version: '14.x' registry-url: 'https://registry.npmjs.org' - name: Install dependencies and build 🔧 - run: npm install --force + run: yarn install --frozen-lockfile - name: Publish package on NPM 📦 run: npm publish ${{ github.event.release.prerelease && '--tag next' || ''}} env: