creat-react-app生成的项目默认端口号是3000,如下可以更改:

在package.json中修改
  "start":"react-scripts start",
为
"start":"set PORT=9000 && react-scripts start",

next.js按文档生成的项目默认也是3000

 "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "next -p 9000"
  },

加  -p 端口号 即可。

相关文章:

  • 2021-06-29
  • 2022-12-23
  • 2021-07-19
  • 2022-02-15
  • 2021-04-29
  • 2022-01-29
  • 2021-04-12
  • 2021-11-30
猜你喜欢
  • 2021-09-17
  • 2022-12-23
  • 2021-06-08
  • 2021-07-25
  • 2021-12-14
  • 2021-04-06
  • 2021-05-17
相关资源
相似解决方案