From ff3289d260abadb5d1ac57a1e7daf5e511fda0be Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Wed, 26 Oct 2022 18:31:20 -0700 Subject: [PATCH] build: use npm@7 for npm view command --- script/release/publish-to-npm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/release/publish-to-npm.js b/script/release/publish-to-npm.js index c55db2f5c9d6..cef87cb30c16 100644 --- a/script/release/publish-to-npm.js +++ b/script/release/publish-to-npm.js @@ -194,7 +194,7 @@ new Promise((resolve, reject) => { }); }) .then((tarballPath) => { - const existingVersionJSON = childProcess.execSync(`npm view electron@${currentElectronVersion} --json`).toString('utf-8'); + const existingVersionJSON = childProcess.execSync(`npx npm@7 view ${rootPackageJson.name}@${currentElectronVersion} --json`).toString('utf-8'); // It's possible this is a re-run and we already have published the package, if not we just publish like normal if (!existingVersionJSON) { childProcess.execSync(`npm publish ${tarballPath} --tag ${npmTag} --otp=${process.env.ELECTRON_NPM_OTP}`);