fix: switch to nodeModulesDir: "manual" (#3588)
The `"auto"` value causes all kinds of race conditions between various processes trying to auto install their view of dependencies.
This commit is contained in:
@@ -86,6 +86,7 @@ export async function initProject(
|
||||
builder?: boolean | null;
|
||||
help?: boolean | null;
|
||||
h?: boolean | null;
|
||||
skipInstall?: boolean | null;
|
||||
} = {},
|
||||
): Promise<void> {
|
||||
const freshVersion = await getLatestVersion("@fresh/core", FRESH_VERSION);
|
||||
@@ -559,7 +560,7 @@ if (Deno.args.includes("build")) {
|
||||
}
|
||||
|
||||
const denoJson = {
|
||||
nodeModulesDir: "auto",
|
||||
nodeModulesDir: "manual",
|
||||
tasks: {
|
||||
check: "deno fmt --check . && deno lint . && deno check",
|
||||
dev: "deno run -A --watch=static/,routes/ dev.ts",
|
||||
@@ -763,6 +764,15 @@ This will watch the project directory and restart as necessary.`;
|
||||
}
|
||||
}
|
||||
|
||||
if (!flags.skipInstall) {
|
||||
console.log("Installing dependencies...");
|
||||
await new Deno.Command(Deno.execPath(), {
|
||||
cwd: unresolvedDirectory,
|
||||
args: ["install"],
|
||||
}).output();
|
||||
console.log("Installing dependencies...%cdone!", "color: green");
|
||||
}
|
||||
|
||||
// Specifically print unresolvedDirectory, rather than resolvedDirectory in order to
|
||||
// not leak personal info (e.g. `/Users/MyName`)
|
||||
console.log(
|
||||
|
||||
Reference in New Issue
Block a user