From d9e15fc33aed40650c99469c67e02a8e0a22f166 Mon Sep 17 00:00:00 2001 From: geekgeekrun Date: Sat, 13 Apr 2024 20:33:04 +0800 Subject: [PATCH] fix script error(module is not imported correctly) in `Patch pnpm` step --- .github/workflows/release-ui.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-ui.yml b/.github/workflows/release-ui.yml index dcb0e5f..829db02 100644 --- a/.github/workflows/release-ui.yml +++ b/.github/workflows/release-ui.yml @@ -30,7 +30,8 @@ jobs: // https://github.com/pnpm/pnpm/issues/5638 const path = require('path') const fs = require('fs') - const npmGlobalModuleFolder = child_process.execSync('npm root -g').toString().trim() + const childProcess = require('child_process') + const npmGlobalModuleFolder = childProcess.execSync('npm root -g').toString().trim() const pnpmCjsFilePath = path.join(npmGlobalModuleFolder, 'pnpm/bin/pnpm.cjs') let pnpmCjsFileContent = fs.readFileSync(pnpmCjsFilePath).toString().replace(/^(#!\/usr\/bin\/env node)/, '#!node') fs.writeFileSync(pnpmCjsFilePath, pnpmCjsFileContent)