mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
fix(task): do not eagerly auto-install packages in package.json when "nodeModulesDir": false
(#21858)
There's no need to auto-install the package.json if the user is not using a node_modules directory. Closes #21850
This commit is contained in:
parent
0efb17b2cb
commit
be888c068c
5 changed files with 33 additions and 4 deletions
|
@ -88,10 +88,13 @@ pub async fn execute_script(
|
|||
}
|
||||
}
|
||||
|
||||
// install the npm packages if we're using a managed resolver
|
||||
if let Some(npm_resolver) = npm_resolver.as_managed() {
|
||||
npm_resolver.ensure_top_level_package_json_install().await?;
|
||||
npm_resolver.resolve_pending().await?;
|
||||
// ensure the npm packages are installed if using a node_modules
|
||||
// directory and managed resolver
|
||||
if cli_options.has_node_modules_dir() {
|
||||
if let Some(npm_resolver) = npm_resolver.as_managed() {
|
||||
npm_resolver.ensure_top_level_package_json_install().await?;
|
||||
npm_resolver.resolve_pending().await?;
|
||||
}
|
||||
}
|
||||
|
||||
let cwd = match task_flags.cwd {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue