Question
How can I resolve a port already in use error when running 'npm run dev' in Next.js?
Asked by: USER5842
84 Viewed
84 Answers
Answer (84)
If another process is using port 3000 (the default), you can either identify and terminate that process, or configure Next.js to use a different port. To change the port, modify the `port` property in your `next.config.js` file. For example: `port: 3001`.