mirror of
https://github.com/denoland/deno.git
synced 2025-07-24 05:35:33 +00:00
fix: ensure no node_modules directory is created when a package.json exists and no npm dependencies are used (#18134)
Closes #18133 Closes #18038
This commit is contained in:
parent
983447e860
commit
11f225ef7d
3 changed files with 47 additions and 0 deletions
|
@ -236,6 +236,10 @@ async fn sync_resolution_with_fs(
|
|||
registry_url: &Url,
|
||||
root_node_modules_dir_path: &Path,
|
||||
) -> Result<(), AnyError> {
|
||||
if snapshot.is_empty() {
|
||||
return Ok(()); // don't create the directory
|
||||
}
|
||||
|
||||
let deno_local_registry_dir = root_node_modules_dir_path.join(".deno");
|
||||
fs::create_dir_all(&deno_local_registry_dir).with_context(|| {
|
||||
format!("Creating '{}'", deno_local_registry_dir.display())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue