20

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
1
  • The error message seems to clearly state what is wrong. name can no longer contain capital letters. Try changing the name of the folder from "folderName" to "foldername" & try. Commented May 10, 2022 at 12:47

3 Answers 3

32

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

Sign up to request clarification or add additional context in comments.

2 Comments

Also works with pnpm create next-app ./
Either try using a new directory name, or remove the files listed above.
11

For Windows users use npx create-next-app@latest ./

Note: Your existing folder name can't contain any uppercase characters. Ex: BookStore can be ==> bookstore or book_store

1 Comment

Not just for windows, works on mac OS too, and probably on Linux as well
1

If you are not able to create a next project inside a current folder then here's how you can do it:

npx create-next-app .

If you get an error while creating regarding naming, then change your folder name to no-caps, you can use em dash(-) if the name contains spaces.

it works for me on Linux and Mac and I am sure it will work on windows too :)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.