Cannot create a project named "myApp" because of npm naming restrictions:

Created at 31-Oct-2022, By samar


Cannot create a project named "myApp" because of npm naming restrictions:

Hello everyone, in this article we will help you to get the solution for the error Cannot create a project named "myApp" because of npm naming restrictions: name can no longer contain capital letters Please choose a different project name. while creating the react app using npx create-react-app <project-name> command.

I was trying to create a new react app  using the npx create-react-app myApp command and I got the error Cannot create a project named "myApp" because of npm naming restrictions

The problem was the naming convention of app names. I got the solution for the above error by changing the app name from myApp to myapp or my-app. The create-react-app command does not support the camelcase naming convention for the app name while using the npx create-react-app command. 

Naming convention for react app while using npx create-react-app command is a kebab case like my-app. You can also use myapp as a react app name to create a react app.

You have to use myapp or my-app for the app name instead of myApp. Just copy/paste the below code in your terminal and hit enter to create a react app within my-app directory.

Command to create react app

npx create-react-app my-app

cd my-app

npm start