for some reason I am not able to start my Next js application. I can not remember to made some changes which could cause this problem and I dont know how to fix it either.
This is the only error message I get in the terminal (after I enter the command ‘npm run dev’):
sh: next: command not found
Can someone help me to figure out whats the issue here?
I just recognized that the node_modules folder is grayed out. In my other projects this is not the case, so it seems something with the node_modules folder is not working.
How can I check whats the issue?
I dont get any error message and I can not check the console.
Please help!!
EDIT: I also recognized that there is no .next folder. What that means? Do I need to install next again?
When I run the command npm run dev or npx next -h or npx next dev I always get this message:
sh: next: command not found
No it is not working. I get the same message:
sh: next: command not found
I already did that a few times, but nothing changed.
As I said, I am not able to start the server so I can not see an error message in the console and all I got is:
sh: next: command not found
My apprehension was that I messed up something within the folder structure, but when I try to open older versions (which worked before) I get the same message.
I think I need to start a new Next JS project from scratch and then copy and paste the files into the new project and connect everything again from scretch. This should work, but anyway it would be great to know what is the probleme here.
I am able to start other projects, but this one I am not able to start any version. All versions will give back the same message in the terminal.
dev is just the argument/command to next you can run it without the argument (it defaults to dev).
./node_modules/next/dist/bin/next
Does npx create-next-app work if you run it inside the Websites folder?
If so does this project work if you move the root folder to the Websites folder? I’m not very familiar with macs but the file path looks a little odd to me. In general I would avoid anything for folder names other than dashes and underscores. Avoid spaces, dots, and so on.