next.js

"command not found: create-next-app" how do I create a next application?


I am using this command to create my app:

npx create-next-app

but it is giving an error:

Error: EPERM: operation not permitted, mkdir 'C:\Users\danyyal'
command not found: create-next-app

how to create the app?

p.s I have node.js installed.


Solution

  • First install create-next-app globally by doing

    npm i -g create-next-app
    

    After you can use create-next-app CLI to create next app.

    If you want to create new next app in current directory do

    create-next-app .
    

    For a named next app just do

    create-next-app your-app-name