shlogg · Early preview
Ramu Narasinga @karthik-m22

Next.js Project Naming Conventions Explained

create-next-app validates project name by checking for lowercase, no spaces, and adherence to npm naming conventions.

In this article, we analyze how create-next-app validates your project name.

validate: (name) => {
 const validation = validateNpmName(basename(resolve(name)))
 if (validation.valid) {
   return true
 }
 return 'Invalid project name: ' + validation.problems[0]
},

    
    

    
    




Have you tried naming your project with spaces in it when using create-next-app command? if you have done so, it won’t allow spaces in your project because it follows certain principles when it comes to naming your project.
So what are these naming convention rules?

  
  
  validateNpmName function

If you...