Home > Back-end >  nexrjs create next-app does create all the required folders
nexrjs create next-app does create all the required folders

Time:05-11

I have installed NextJS using both methods npm install next react react-dom and npx create-next-app appname multiple times, but the directories are supposed to look like:

pages, api(_app.js, index.js), public, styles, .next, node_modules

But in MY project they look like: node_modules, yarn.lock, package.json

I saw multiple installation procedures but they all give the same project directories (latter) TO ME, and the former directories in their tutorials. I cannot follow any tutorials on nextjs due to this! I have re-installed yarn and nodejs several times, but it still didn't work.

CodePudding user response:

Don't worry about yarn or node, if you're using npx it's always going to be the latest version. The best advice I can give you is double and triple check you are running it in the folder you think you are. I just ran it to check and there's nothing wrong with next. Here's the steps.

cd folderJustAboveWhereIWant
npx create-next-app myAppNameHere
cd myAppNameHere
npm run start

And wahla... The pretty cool looking next starter page should pop on port I think 8080? If you need help along the way reach out directly if stack allows it.

CodePudding user response:

By installing next app multiple times you made yourself confusion! Now make a new folder:

step 1 : open powershell window there

step 2 : download yarn if you do not have downloaded, it is too faster and simpler than npm/npx

step 3 : run command yarn create next-app

step 4 : it will ask for project name in terminal.

And that's it! your next app is created! To run the next app run command yarn run dev And again I would like to recommend you to download yarn for next apps, it will surely give a blow to your next app! Happy Coding!

  • Related