Skip to content

Commit e70da99

Browse files
authored
fix: allow npm list to work on yarn berry and bun project setups (#9443)
1 parent 85437a7 commit e70da99

File tree

4 files changed

+15776
-12488
lines changed

4 files changed

+15776
-12488
lines changed

.changeset/chubby-donuts-live.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"app-builder-lib": patch
3+
---
4+
5+
fix: disable corepack strict mode (with optional override) to allow `npm list` to work on yarn berry and bun project setups

packages/app-builder-lib/src/node-module-collector/nodeModulesCollector.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ export abstract class NodeModulesCollector<ProdDepType extends Dependency<ProdDe
256256

257257
const child = childProcess.spawn(command, args, {
258258
cwd,
259+
env: { COREPACK_ENABLE_STRICT: "0", ...process.env }, // allow `process.env` overrides
259260
shell: false, // required to prevent console logs polution from shell profile loading when `true`
260261
})
261262

@@ -389,7 +390,7 @@ export abstract class NodeModulesCollector<ProdDepType extends Dependency<ProdDe
389390
let entries: string[]
390391
try {
391392
entries = await fs.readdir(dir)
392-
} catch (e) {
393+
} catch {
393394
continue
394395
}
395396
for (const entry of entries) {

0 commit comments

Comments
 (0)