node.jsreactjsnext.js

npx create-next-app@latest is giving errors


I am trying to create a new nextjs app but I get a npm ERR! ENOTEMPTY: directory not empty error. Please the image below the screenshot of the errors

Its been working fine for the past year I am not sure what really happened.

Please help me out I couldnt find any answers on Google.

node version
v19.8.1
npm version
9.5.1
React version
18.2.0
Next version
13.2.4
OS version
Ubuntu 22.04

Solution

  • You should try this first

    npm init 
    npm install create-next-app@latest --save
    npm create-next-app <appname>
    

    If it's not work you might use stable version of node like 18.15.0
    If you don't know how to switch node version this will help you
    https://github.com/nvm-sh/nvm

    And try your step
    hope it's work!