I have a reactjs/typescript project, running on windows 10. Im trying to build by ts-scripts with
\"rimraf ../wwwroot/* && react-scripts-ts build
I had a similar issue, although on a Mac computer. Setting an environment variable did the trick for me. That way, your node process will take the value and use it independently of which script you're running.
export NODE_OPTIONS=--max_old_space_size=4096
The run your command again. Good Luck!