10

I downloaded the React App package from the link create-react-app. The default port it assigns is port:3000

How to Change this port to a custom port like 3002 or 3006 ?

Sanchit Bhatnagar
  • 814
  • 2
  • 10
  • 16

1 Answers1

47

modify part of package.json from:

"start": "react-scripts start"

for Linux and MacOS to:

"start": "PORT=3006 react-scripts start"

Windows to:

"start": "set PORT=3006 && react-scripts start"
Dinesh undefined
  • 5,362
  • 2
  • 17
  • 39
nishant
  • 2,406
  • 1
  • 12
  • 19