Skip to content

Conversation

dsherret
Copy link
Member

@dsherret dsherret commented Aug 22, 2025

Changes it to use a temp directory for node_modules folders for deno init --npm

Closes #29513

@dsherret dsherret requested a review from bartlomieju August 22, 2025 18:03
@bartlomieju
Copy link
Member

I'm not sure I'm a fan of this PR - I think it's better to have "node_modules" directory, than some packages not work. Can you give some more context on why you think this is better?

@dsherret
Copy link
Member Author

dsherret commented Aug 22, 2025

@bartlomieju it currently creates a node_modules folder in the cwd, which then needs to be deleted (or gets merged into the current project if initializing in the cwd):

> deno init --npm <some-package>
...follow prompts and create an "example" project...
> ls
node_modules
example

@dsherret
Copy link
Member Author

image

@nathanwhit
Copy link
Member

We should put them in a temp directory. That's what other package managers do

@dsherret dsherret changed the title fix(init): do not create a node_modules folder for deno init --npm ... fix(init): use temp node_modules folders for deno init --npm ... Aug 29, 2025
@dsherret dsherret requested a review from nathanwhit August 29, 2025 21:39
Copy link
Member

@nathanwhit nathanwhit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, LGTM!

@dsherret dsherret enabled auto-merge (squash) August 29, 2025 23:00
@dsherret dsherret merged commit daa412b into denoland:main Aug 29, 2025
45 of 53 checks passed
@dsherret dsherret deleted the fix_no_node_modules_folder_deno_init_npm branch August 30, 2025 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove node_modules folder created for initializing an NPM project
3 participants