#Hello, I am following this video https://www.youtube.com/watch?v=wm5gMKuwSYk

16 messages · Page 1 of 1 (latest)

marsh herald
#

at about 52:00 he runs the command 'npm run dev'. I followed the steps and I am receiving an error:
Missing Script: "dev"

The script is present in the file in my screenshot, I am not sure what to do, I tried searching this forum for the answer did not find it. Thank you in advance 🙏

ashen basalt
#

Reinstall npm

marsh herald
#

Thanks. I did clear the cache too I should have mentioned that but I will try everything again.

jovial sparrow
#

It looks like you have a promtopia folder inside the promtopia folder. You have to go one level deeper. Type:

cd promptopia
npm run dev
marsh herald
#

❤️ ❤️

jovial sparrow
#

The terminal is at the outer level but package.json is on the inner level.

marsh herald
#

Ok thank you so much, I will try this later after work.

marsh herald
#

hmm yeah for some reason I have this extra folder that he doesn't have in the video

#

I noticed when I started the project when I ran npx create-next-app@latest -- it asked me slightly different questions than in the video.

#

It asked me the project name, I think that is where this folder is coming from.

#

I cd'd into the inner folder and ran the npm run dev, it still gave me an error. I am gonna try and mess with this file structure.

PS C:\Users\johng\OneDrive\Desktop\Promptopia> cd .\promptopia\  
PS C:\Users\johng\OneDrive\Desktop\Promptopia\promptopia> npm run dev

> [email protected] dev
> next dev

- ready started server on [::]:3000, url: http://localhost:3000
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry
Error: > Couldn't find any `pages` or `app` directory. Please create one under the project root
    at findPagesDir (C:\Users\johng\OneDrive\Desktop\Promptopia\promptopia\node_modules\next\dist\lib\find-pages-dir.js:54:15)
    at initialize (C:\Users\johng\OneDrive\Desktop\Promptopia\promptopia\node_modules\next\dist\server\lib\router-server.js:66:71)
    at async Server.<anonymous> (C:\Users\johng\OneDrive\Desktop\Promptopia\promptopia\node_modules\next\dist\server\lib\start-server.js:178:36)
PS C:\Users\johng\OneDrive\Desktop\Promptopia\promptopia>```
#

I added this and it seems to be working now. Thanks.

marsh herald
#

actually im getting another error `Server Error
Error: The default export is not a React Component in page: "/"

This error happened while generating the page. Any console logs will be displayed in the terminal window.`

#

I think because my index.js is blank