Next.js Discord

Discord Forum

Tailwind Ui Template next js error

Answered
Velvet ant posted this in #help-forum
Open in Discord
Velvet antOP
I used this tailwind ui template https://tailwindui.com/templates/spotlight and when trying to view it in my browser from the code editor, i get an error saying there is no pages or app directory?
Answered by Ray
cd sportlight-js
View full answer

47 Replies

Velvet antOP
@Ray could you show the folder structure?
Velvet antOP
is this what you were looking for?
@Velvet ant is this what you were looking for?
yes run ls
@Ray yes run `ls`
Velvet antOP
@Velvet ant Click to see attachment
cd sportlight-js
Answer
npm run dev
@Ray `cd sportlight-js`
Velvet antOP
keeps giving errors lol
@Velvet ant keeps giving errors lol
did you run npm install?
@Ray did you run `npm install`?
Velvet antOP
yea
try to run again
Velvet antOP
ok
@Ray try to run again
Velvet antOP
try npm i --force
@Ray try `npm i --force`
Velvet antOP
same error again
@Velvet ant same error again
what is your node version?
Velvet antOP
v20.11.0
@Velvet ant v20.11.0
run ls again
Velvet antOP
@Velvet ant Click to see attachment
try to delete package-lock.json and run npm i --force again
@Ray try to delete `package-lock.json` and run `npm i --force` again
Velvet antOP
same error again 😭
@Velvet ant Click to see attachment
run npm install
@Ray run `npm install`
Velvet antOP
same thing
@Velvet ant same thing
could you show the error
@Ray could you show the error
Velvet antOP
@Velvet ant Click to see attachment
npx next info
Velvet antOP
@Velvet ant Click to see attachment
try npm install --save next@latest --include=optional
@Ray try `npm install --save next@latest --include=optional`
Velvet antOP
@Velvet ant Click to see attachment
first time creating nextjs on this device?
@Ray first time creating nextjs on this device?
Velvet antOP
yea i just bought it yesterday night
didnt have these issues on my last macbook
@Velvet ant yea i just bought it yesterday night
try npx create-next-app@latest on other folder
Velvet antOP
what other folder
different directory
cd ..
Velvet antOP
@Velvet ant Click to see attachment
can you run it?
Velvet antOP
yea it works on the local host
ive only had issues using the tailwind ui templates
@Velvet ant yea it works on the local host
ok go back to the template folder and run rm -rf node_modules && rm -rf .next && rm -rf package-lock.json then npm install
Velvet antOP
cd spotlight-js
Velvet antOP
@Velvet ant Click to see attachment
npm install @mapbox/rehype-prism
@Ray `npm install @mapbox/rehype-prism`
Velvet antOP
thank you bro