Skip to content

Commit 3674584

Browse files
authored
fix: require.resolve call not finding @astrojs/check (#8237)
1 parent 3ad5a2a commit 3674584

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/strange-peas-agree.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'astro': patch
3+
---
4+
5+
Fix `astro check` not finding the `@astrojs/check` package

packages/astro/src/cli/install-package.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export async function getPackage<T>(
2222

2323
let packageImport;
2424
try {
25-
require.resolve(packageName);
25+
require.resolve(packageName, { paths: [options.cwd ?? process.cwd()] });
2626

2727
// The `require.resolve` is required as to avoid Node caching the failed `import`
2828
packageImport = await import(packageName);

0 commit comments

Comments
 (0)