summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.changeset/strange-peas-agree.md5
-rw-r--r--packages/astro/src/cli/install-package.ts2
2 files changed, 6 insertions, 1 deletions
diff --git a/.changeset/strange-peas-agree.md b/.changeset/strange-peas-agree.md
new file mode 100644
index 000000000..e13039e98
--- /dev/null
+++ b/.changeset/strange-peas-agree.md
@@ -0,0 +1,5 @@
+---
+'astro': patch
+---
+
+Fix `astro check` not finding the `@astrojs/check` package
diff --git a/packages/astro/src/cli/install-package.ts b/packages/astro/src/cli/install-package.ts
index 919ede0e2..bc3f2df1f 100644
--- a/packages/astro/src/cli/install-package.ts
+++ b/packages/astro/src/cli/install-package.ts
@@ -22,7 +22,7 @@ export async function getPackage<T>(
let packageImport;
try {
- require.resolve(packageName);
+ require.resolve(packageName, { paths: [options.cwd ?? process.cwd()] });
// The `require.resolve` is required as to avoid Node caching the failed `import`
packageImport = await import(packageName);