cli icon indicating copy to clipboard operation
cli copied to clipboard

"npm create nuxt@latest" and unnamed projects

Open DarlanPrado opened this issue 3 months ago • 6 comments

The command "npm create nuxt@latest" and its derivatives do not correctly recognize projects without a name. I noticed an error when trying to create a project without a name but with additional parameters. For example, in nuxtUI, "npm create nuxt@latest -- -t ui" is used, but the CLI doesn't understand that the project is unnamed and instead creates a project named "-t" without using the correct template.

In this scenario, what I usually do is pass something like "./" in the project name, so it understands that it's undefined and sends it to the expected options.

(Btw, it would be nice if, instead of specifying the project name, I could directly specify the target directory — for example "./", when I want the project to be created in the current folder rather than inside a new one.)

DarlanPrado avatar Nov 08 '25 06:11 DarlanPrado

are you running on windows?

danielroe avatar Nov 08 '25 07:11 danielroe

yes

DarlanPrado avatar Nov 08 '25 21:11 DarlanPrado

this is working fine for me on PowerShell:

Image

...and terminal (the 'undefined' prompt is an annoying separate issue)

Image

can you tell me more about how to reproduce?

danielroe avatar Nov 21 '25 12:11 danielroe

I ran some tests and kept getting the same error, and upon comparison I understood the problem. I'm using pnpm, but if I use npm it works as expected.

Image

DarlanPrado avatar Nov 21 '25 23:11 DarlanPrado

with pnpm you do not use the double dash

danielroe avatar Nov 22 '25 18:11 danielroe

Yes, it works this way. I tried creating it with yarn to see if the same thing happens, but it generates another problem.

DarlanPrado avatar Nov 25 '25 21:11 DarlanPrado