Next.js Discord

Discord Forum

Local server not running after I install a package / update nextjs

Answered
Giant panda posted this in #help-forum
Open in Discord
Giant pandaOP
So I just opened my project after 1 month, and whenever I install a package and try to run 'npm run dev', it does not start the local server. I tried updating to nextjs 14, but even doing that causes the same problem.
Answered by Ray
maybe try installing node 20.10.0 LTS
View full answer

66 Replies

@Ray do you get any error?
Giant pandaOP
No. It just cancels
Doesnt matter which package I install
I'm getting these errors tho when I run it before installing anything. But when I check the lines, there doesn't seem to be a typo there. What does this error mean? They didn't show up a month ago.
@Giant panda Click to see attachment
can you run ls?
Giant pandaOP
@Giant panda Click to see attachment
have you tried to delete .next and node_modules?
@Giant panda Click to see attachment
and what are the version of next and node?
@Ray and what are the version of next and node?
Giant pandaOP
"next": "^13.5.4",
node: v21.5.0
@Ray have you tried to delete `.next` and `node_modules`?
Giant pandaOP
I haven't. Should I try that?
@Giant panda I haven't. Should I try that?
yeah try that
Giant pandaOP
What should I do after?
@Giant panda What should I do after?
npm install && npm run dev
Giant pandaOP
Is this concerning
@Giant panda Is this concerning
its fine
Giant pandaOP
Still same issue
@Giant panda Click to see attachment
same as this?
Giant pandaOP
Yea..
@Giant panda Yea..
ah try create a new project with npx create-next-app@latest and see if it works
Giant pandaOP
A new project in another directory?
Giant pandaOP
@Ray yes try it
Giant pandaOP
it starts and stops
@Giant panda it starts and stops
stop immediately?
Giant pandaOP
after like 6 seconds
@Giant panda after like 6 seconds
try run this
PORT=5000 npm run dev
Giant pandaOP
@Giant panda Click to see attachment
npm run dev --port 5000
Giant pandaOP
Doesn't change the port. I changed this line in package.json "dev": "next dev -p 5000",
Still issue persists tho
@Giant panda Still issue persists tho
run npx next info
Giant pandaOP
@Giant panda Click to see attachment
did you upgrade the version of node?
@Giant panda Click to see attachment
maybe try installing node 20.10.0 LTS
Answer
@Ray maybe try installing node 20.10.0 LTS
Giant pandaOP
How do I do that?
From previous versions from the website?
install LTS one
Giant pandaOP
Oh
Okay
@Giant panda Click to see attachment
run set-ExecutionPolicy RemoteSigned -Scope CurrentUser
Giant pandaOP
That fixed it. It starts now :sekiroHype:
@Giant panda What are these warnings?
do you still getting those warning?
@Ray do you still getting those warning?
Giant pandaOP
Yes
@Giant panda Click to see attachment
where do you load the nprogress.min.css style?
Giant pandaOP
in _app.js
When route is changing, it shows a progress bar at the top.
Oh
I found where the typo is
@Giant panda When route is changing, it shows a progress bar at the top.
create a page/_document.js and put the link tag there
import { Html, Head, Main, NextScript } from 'next/document'
 
export default function Document() {
  return (
    <Html>
      <Head>
        <link rel="stylesheet" href="..." />
      </Head>
      <body>
        <Main />
        <NextScript />
      </body>
    </Html>
  )
}
Giant pandaOP
Thank you. That got rid of those warnings.
Should I update caniuse-lite
@Giant panda Should I update `caniuse-lite`
I think its ok to update if you need
Giant pandaOP
Alright. That has fixed everything I have been encountering.
Should I update my project to nextjs 14?
@Giant panda Should I update my project to nextjs 14?
sure if you can
Giant pandaOP
Which command do i use
@Giant panda Which command do i use
npm install next@latest
Giant pandaOP
Thank you so much dude. Life saver. All issues are fixed for now.
:ellenp2Love: