简体   繁体   中英

How can I use Procfile for my react app on heroku plateform

I am working with react and I need to upload my project on Heroku platform so I tried to upload on Heroku and got Error R14 (Memory quota exceeded) this error and I read about this error so I created a file procfile and added:

web: node --optimize_for_size --max_old_space_size=920 --gc_interval=100 server.js

But now it is generated a new issue Error: Cannot find module '/app/server.js so what can I do to solve this issue??

in Procfile

web: react-scripts --optimize_for_size --max_old_space_size=920 --gc_interval=100 start

OR

in package.json

"scripts": {
    "start": "react-scripts --optimize_for_size --max_old_space_size=920 --gc_interval=100 start",
    "build": "react-scripts --optimize_for_size --max_old_space_size=920 --gc_interval=100 build",
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM