Skip to content

Commit

Permalink
Fix compatibility with npm 10 (#737)
Browse files Browse the repository at this point in the history
  • Loading branch information
voxpelli authored Mar 13, 2024
1 parent 3b6b9c8 commit 9fdebd5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions source/npm/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,12 @@ export const checkIgnoreStrategy = async ({files}, rootDirectory) => {
};

export const getFilesToBePacked = async rootDirectory => {
const {stdout} = await execa('npm', ['pack', '--dry-run', '--json'], {cwd: rootDirectory});
const {stdout} = await execa('npm', ['pack', '--dry-run', '--json', '--silent'], {cwd: rootDirectory});

const {files} = JSON.parse(stdout).at(0);
return files.map(file => file.path);
try {
const {files} = JSON.parse(stdout).at(0);
return files.map(file => file.path);
} catch (error) {
throw new Error('Failed to parse output of npm pack', {cause: error});
}
};

0 comments on commit 9fdebd5

Please sign in to comment.