Добрый день. Скажите пожалуйста как мне заменить порт на реакте, если я запускаю через консоль(что в моём случае не корректно при установке на хостинг), порт выходит рандомный, а у меня он фиксированный, погуглил, попробовал команды типа static-server POST=8080 и т.д., выдаёт command not found, воот..
Хостинг позволяет запускать из package.json, но мне нужно зафиксировать порт, может там есть файл конфига для подобной ситуации? Спасибо.
2020-02-19_10:16:43.61962 [2J[3J[H[32m?[39m [1m[33mSomething is already running on port 3000.[39m[22m
2020-02-19_10:16:43.69223 [1m[22m
2020-02-19_10:16:43.69224 [1mWould you like to run the app on another port instead?[22m[0m [0m[2m(Y/n) [22m[61D[61CSleep 60 secs. before restart due to previous errors...
2020-02-19_10:17:01.59386 Sleep 3 secs. before restart due to previous errors...
2020-02-19_10:17:05.13303
2020-02-19_10:17:05.13306 > my-app@0.1.0 start /home/c17400/youdecide.na4u.ru/www
2020-02-19_10:17:05.13306 > react-scripts start
2020-02-19_10:17:05.13306
2020-02-19_10:17:06.76649 [2J[3J[H[32m?[39m [1m[33mSomething is already running on port 3000.[39m[22m
2020-02-19_10:17:06.86468 [1m[22m
2020-02-19_10:17:06.86468 [1mWould you like to run the app on another port instead?[22m[0m [0m[2m(Y/n) [22m[61D[61C
2020-02-19_10:20:51.79461 > my-app@0.1.0 start /home/c17400/youdecide.na4u.ru/www
2020-02-19_10:20:51.79461 > PORT=53178 react-scripts start
2020-02-19_10:20:51.79462
2020-02-19_10:20:53.37256 [2J[3J[H[32m?[39m [1m[33mSomething is already running on port 53178.[39m[22m
2020-02-19_10:20:53.43467 [1m[22m
2020-02-19_10:20:53.43468 [1mWould you like to run the app on another port instead?[22m[0m [0m[2m(Y/n) [22m[61D[61C
2020-02-19_10:22:20.08950 > my-app@0.1.0 start /home/c17400/youdecide.na4u.ru/www
2020-02-19_10:22:20.08951 > static-server -p 53178 react-scripts start
2020-02-19_10:22:20.08951
2020-02-19_10:22:20.09585 sh: static-server: command not found
2020-02-19_10:22:20.09965 [37;40mnpm[0m [0m[31;40mERR![0m [0m[35mcode[0m ELIFECYCLE
2020-02-19_10:22:20.10001 [0m[37;40mnpm[0m [0m[31;40mERR![0m [0m[35msyscall[0m spawn
2020-02-19_10:22:20.10450 [0m[37;40mnpm[0m [0m[31;40mERR![0m [0m[35mfile[0m sh
2020-02-19_10:22:20.10467 [0m[37;40mnpm[0m [0m[31;40mERR![0m [0m[35merrno[0m ENOENT
2020-02-19_10:22:20.10495 [0m[37;40mnpm[0m [0m[31;40mERR![0m[35m[0m my-app@0.1.0 start: `static-server -p 53178 react-scripts start`
2020-02-19_10:22:20.10630 [0m[37;40mnpm[0m [0m[31;40mERR![0m[35m[0m spawn ENOENT
2020-02-19_10:22:20.10649 [0m[37;40mnpm[0m [0m[31;40mERR![0m[35m[0m
2020-02-19_10:22:20.10670 [0m[37;40mnpm[0m [0m[31;40mERR![0m[35m[0m Failed at the my-app@0.1.0 start script.
2020-02-19_10:22:20.10690 [0m[37;40mnpm[0m [0m[31;40mERR![0m[35m[0m This is probably not a problem with npm. There is likely additional logging output above.
2020-02-19_10:22:20.10706 [0m
2020-02-19_10:22:20.11301 [37;40mnpm[0m [0m[31;40mERR![0m[35m[0m A complete log of this run can be found in:
2020-02-19_10:22:20.11314 [0m[37;40mnpm[0m [0m[31;40mERR![0m[35m[0m /home/c17400/youdecide.na4u.ru/.npm/_logs/2020-02-19T10_22_20_108Z-debug.log
2020-02-19_10:22:20.11327 [0mSleep 3 secs. before restart due to previous errors...
2020-02-19_10:22:24.99077
2020-02-19_10:22:24.99081 > my-app@0.1.0 start /home/c17400/youdecide.na4u.ru/www
2020-02-19_10:22:24.99081 > static-server -p 53178 react-scripts start
2020-02-19_10:22:24.99081
2020-02-19_10:22:24.99863 sh: static-server: command not found
2020-02-19_10:22:25.00130 [37;40mnpm[0m [0m[31;40mERR![0m [0m[35mcode[0m ELIFECYCLE
2020-02-19_10:22:25.00135 [0m[37;40mnpm[0m [0m[31;40mERR![0m [0m[35msyscall[0m spawn
2020-02-19_10:22:25.00162 [0m[37;40mnpm[0m [0m[31;40mERR![0m [0m[35mfile[0m sh
2020-02-19_10:22:25.00172 [0m[37;40mnpm[0m [0m[31;40mERR![0m [0m[35merrno[0m ENOENT
2020-02-19_10:22:25.00187 [0m[37;40mnpm[0m [0m[31;40mERR![0m[35m[0m my-app@0.1.0 start: `static-server -p 53178 react-scripts start`
2020-02-19_10:22:25.00284 [0m[37;40mnpm[0m [0m[31;40mERR![0m[35m[0m spawn ENOENT
2020-02-19_10:22:25.00289 [0m[37;40mnpm[0m [0m[31;40mERR![0m[35m[0m
2020-02-19_10:22:25.00304 [0m[37;40mnpm[0m [0m[31;40mERR![0m[35m[0m Failed at the my-app@0.1.0 start script.
2020-02-19_10:22:25.00311 [0m[37;40mnpm[0m [0m[31;40mERR![0m[35m[0m This is probably not a problem with npm. There is likely additional logging output above.
2020-02-19_10:22:25.00321 [0m
2020-02-19_10:22:25.00826 [37;40mnpm[0m [0m[31;40mERR![0m[35m[0m A complete log of this run can be found in:
2020-02-19_10:22:25.00826 [0m[37;40mnpm[0m [0m[31;40mERR![0m[35m[0m /home/c17400/youdecide.na4u.ru/.npm/_logs/2020-02-19T10_22_25_003Z-debug.log
2020-02-19_10:22:25.00826 [0mSleep 60 secs. before restart due to previous errors...
2020-02-19_10:23:25.88808
2020-02-19_10:23:25.88810 > my-app@0.1.0 start /home/c17400/youdecide.na4u.ru/www
2020-02-19_10:23:25.88810 > react-scripts start
2020-02-19_10:23:25.88811
2020-02-19_10:23:27.51654 [2J[3J[H[32m?[39m [1m[33mSomething is already running on port 3000.[39m[22m
2020-02-19_10:23:27.59038 [1m[22m
2020-02-19_10:23:27.59038 [1mWould you like to run the app on another port instead?[22m[0m [0m[2m(Y/n) [22m[61D[61C
2020-02-19_10:25:04.58138 > my-app@0.1.0 start /home/c17400/youdecide.na4u.ru/www
2020-02-19_10:25:04.58139 > $ set -a $ PORT=53178 & react-scripts start
2020-02-19_10:25:04.58139
2020-02-19_10:25:04.59008 sh: $: command not found
2020-02-19_10:25:06.50080 [2J[3J[H[32m?[39m [1m[33mSomething is already running on port 3000.[39m[22m
2020-02-19_10:25:06.58755 [1m[22m
2020-02-19_10:25:06.58755 [1mWould you like to run the app on another port instead?[22m[0m [0m[2m(Y/n) [22m[61D[61C
2020-02-19_10:25:34.49055 > my-app@0.1.0 start /home/c17400/youdecide.na4u.ru/www
2020-02-19_10:25:34.49055 > react-scripts start
2020-02-19_10:25:34.49056
2020-02-19_10:25:36.00267 [2J[3J[H[32m?[39m [1m[33mSomething is already running on port 3000.[39m[22m
2020-02-19_10:25:36.08400 [1m[22m
2020-02-19_10:25:36.08401 [1mWould you like to run the app on another port instead?[22m[0m [0m[2m(Y/n) [22m[61D[61C
2020-02-19_10:46:14.44855 > my-app@0.1.0 start /home/c17400/youdecide.na4u.ru/www
2020-02-19_10:46:14.44855 > PORT=53178 react-scripts start
2020-02-19_10:46:14.44855
2020-02-19_10:46:16.12685 [2J[3J[H[32m?[39m [1m[33mSomething is already running on port 53178.[39m[22m
2020-02-19_10:46:16.18577 [1m[22m
2020-02-19_10:46:16.18577 [1mWould you like to run the app on another port instead?[22m[0m [0m[2m(Y/n) [22m[61D[61C
2020-02-19_10:50:28.71509 > my-app@0.1.0 start /home/c17400/youdecide.na4u.ru/www
2020-02-19_10:50:28.71509 > react-scripts start
2020-02-19_10:50:28.71510
2020-02-19_10:50:30.34448 [2J[3J[H[32m?[39m [1m[33mSomething is already running on port 53178.[39m[22m
2020-02-19_10:50:30.48303 [1m[22m
2020-02-19_10:50:30.48304 [1mWould you like to run the app on another port instead?[22m[0m [0m[2m(Y/n) [22m[61D[61C
2020-02-19_10:51:45.18849 > my-app@0.1.0 start /home/c17400/youdecide.na4u.ru/www
2020-02-19_10:51:45.18849 > set PORT=53178 && react-scripts start
2020-02-19_10:51:45.18850
2020-02-19_10:51:46.77697 [2J[3J[H[32m?[39m [1m[33mSomething is already running on port 53178.[39m[22m
2020-02-19_10:51:46.84017 [1m[22m
2020-02-19_10:51:46.84018 [1mWould you like to run the app on another port instead?[22m[0m [0m[2m(Y/n) [22m[61D[61C
2020-02-19_10:59:09.59363 > my-app@0.1.0 start /home/c17400/youdecide.na4u.ru/www
2020-02-19_10:59:09.59364 > cross-env PORT=53178 react-scripts start
2020-02-19_10:59:09.59364
2020-02-19_10:59:11.37022 [2J[3J[H[32m?[39m [1m[33mSomething is already running on port 53178.[39m[22m
2020-02-19_10:59:11.43383 [1m[22m
Владимир, самый последний коммент, первые строки пишут что у вас что-то занимает 3000, вы на него меняли?
Если нет, то значит не поменяли. Может, вам сервер мешает заменить конфиг, не знаю почему.