denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
98.01k stars 5.39k forks source link

fix(install): don't re-set up node_modules if running lifecycle script #26984

Open nathanwhit opened 20 hours ago

nathanwhit commented 20 hours ago

Fixes https://github.com/denoland/deno/issues/26904

If using nodeModulesDir: "auto", it's possible for the lifecycle script subprocess to try to set up the node_modules dir (despite the fact that we're already doing that). If it does that, it hangs trying to acquire the file lock on the node_modules dir.

As a fix, don't try to set up node_modules if we're running as part of a lifecycle script.

Ideally we'd have better control over when we do and don't set up node_modules automatically (that's the underlying problem behind #25782 as well)