想了解具体的可参考 https://www.jianshu.com/p/6effa6f8059b

1. 第一种:在node_modules\react-scripts\bin\react-scripts.js 中找到DEFAULT_PORT=parseInt(process.env,PORT,10)||3000 将3000改为4000即可
2. 第二种:在packjson.json中将script中将 "start": "react-scripts start" 改为 "start": "set PORT=3001&&react-scripts start"

用create-react-app创建项目后怎么把默认的3000端口改掉?

 

相关文章:

  • 2021-11-04
  • 2021-07-04
  • 2022-02-27
  • 2021-10-30
  • 2021-05-21
  • 2021-12-19
  • 2021-11-30
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-17
  • 2021-04-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案