I have npm installed forever, also npm installed ts-node, and npm installed typescript to try and get this API running. I have been trying " forever start -v -c ts-node ./lib/server.ts" or "forever start -v -v ts-node ./lib/app.ts" and many variations to run it but forever logs throws an error
events.js:187
throw er; // Unhandled 'error' event
^
Error: spawn tail ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn tail',
path: 'tail',
spawnargs: [ '-n', 100, 'C:\\Users\\*****\\.forever\\P0EG.log' ]
If I follow that log file it says
'ts' is not recognized as an internal or external command, operable program or batch file. error: Forever detected script exited with code: 1
I have been working on this for days and cant seem to figure out the solution, I need to run the server in the background without the need to have VSCode or any other window open since this will run on a VM and need it to always be up for the client to be able to hit its endpoints. this is the folder structure of the project, and the client side is a Angular project if that matters
First of all to fix this I had to run 'npm run prod' this triggered an npm build that gave me the dist folder that I needed with the app.js and server.js files
Then I found that there was an issue with the newest version of Forever being able to read file spaces in the 'C:Program Files' so we downgraded to forever v1.0.1 once i did this i ran 'forever start server.js' and this got my api running on the correct port and my Angular application was able to hit it.