diff options
author | 2023-08-26 11:26:20 +0200 | |
---|---|---|
committer | 2023-08-26 11:26:20 +0200 | |
commit | 3674584e02b161a698b429ceb66723918fdc56ac (patch) | |
tree | 76dba4f2bced380a4029062dca6851c234594374 | |
parent | 3ad5a2a28744dc18e6d5962b53934c97a749e9d1 (diff) | |
download | astro-3674584e02b161a698b429ceb66723918fdc56ac.tar.gz astro-3674584e02b161a698b429ceb66723918fdc56ac.tar.zst astro-3674584e02b161a698b429ceb66723918fdc56ac.zip |
fix: require.resolve call not finding @astrojs/check (#8237)
-rw-r--r-- | .changeset/strange-peas-agree.md | 5 | ||||
-rw-r--r-- | packages/astro/src/cli/install-package.ts | 2 |
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); |