Next.js Discord

Discord Forum

npm run dev return "error > couldn't find any pages ..." (new webstorm project)

Answered
West African Lion posted this in #help-forum
Open in Discord
West African LionOP
I haven't done anything after running the npm create-next-app@latest

Is there a way to help find the app / pages directory? It exists.

Error: > Couldn't find any `pages` or `app` directory. Please create one under the project root
    at findPagesDir (/home/bao/WebstormProjects/node_modules/next/dist/lib/find-pages-dir.js:42:15)
    at initialize (/home/bao/WebstormProjects/node_modules/next/dist/server/lib/router-server.js:69:69)
    at async Server.<anonymous> (/home/bao/WebstormProjects/node_modules/next/dist/server/lib/start-server.js:221:36)
Answered by West African Lion
Thanks! I fixed it. WebStorm has a built-in support for Next where it auto-runs the command npx --yes create-next-app , but it still failed. After I removed sudo apt-get remove nodejs package, it worked. Maybe there was a conflict? =\
View full answer

4 Replies

click Ctrl+j in vscode and then try npm run dev
West African LionOP
I get the error above. I use Webstorm IDE
West African LionOP
Thanks! I fixed it. WebStorm has a built-in support for Next where it auto-runs the command npx --yes create-next-app , but it still failed. After I removed sudo apt-get remove nodejs package, it worked. Maybe there was a conflict? =\
Answer