From 3f8477d9def33996eca8298da72315a073c543a9 Mon Sep 17 00:00:00 2001 From: LekoArts Date: Tue, 7 Mar 2023 14:26:58 +0000 Subject: [PATCH] chore: Update get-unowned-packages script to use npm 9 syntax --- scripts/get-unowned-packages/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/get-unowned-packages/index.js b/scripts/get-unowned-packages/index.js index 260efb0fb925f..1b90cd23ebf1c 100644 --- a/scripts/get-unowned-packages/index.js +++ b/scripts/get-unowned-packages/index.js @@ -8,7 +8,8 @@ const { exec, execSync } = require(`child_process`) const execP = util.promisify(exec) const getPackagesWithReadWriteAccess = async user => { - const cmd = `npm access ls-packages ${user}` + // Requires npm 9.0.0 or higher + const cmd = `npm access list packages ${user} --json` const { stdout } = await execP(cmd) const permissions = JSON.parse(stdout) return Object.entries(permissions).reduce((lookup, [pkgName, access]) => {