'How to create a next.js app directly in the current folder

How I can create next-app in the current folder?

I tried:

npx create-next-app@latest .  --ts --use-npm

But I get error:

Could not create a project called "folderName" because of npm naming restrictions:
 * name can no longer contain capital letters


Solution 1:[1]

if you are using linux or mac try this

npx create-next-app@latest ./ --ts --use-npm

it is working for me on both linux and mac

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Amin