javascript - 如何更改 react js中的默认端口

我可以使用默认端口 3000 启动 React js。但是,当我将端口自定义为 4200 时,"start": "PORT=4200 react-scripts start"(刚刚在package.json),我无法启动 React js 应用程序。

'PORT' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! todo-app@0.1.0 start: `PORT=4200 react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the todo-app@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional lo
ging output above.

npm ERR! A complete log of this run can be found in:

相关文章:

.net - string 是不可变的,而 stringbuilder 是可变的

vb.net - 如何拆分逗号分隔的字符串?

python - 如何将 __repr__ 与多个参数一起使用?

objective-c - 比较 objective-C 中的 2 个字符串

python - 如何获取和使用 Dropbox API 的刷新 token (Python 3.x

java - 为什么我在 Java 中对 char 和 int 进行比较不起作用?

macos - Applescript 制作新文件夹

xml - 任何想法为什么图案化的 SVG 文件在浏览器中显示为空白?

php - 无法移 Action 曲家

ios - Firebase 未正确初始化