Step to start node application won't complete

As the final step in a deploy process I am running a powershell script to start a node application using the NPM package “forever”. Although the step starts the node application, the step never completes; it stays in executing mode indefinitely. When run manually from the command line, the command completes and control returns to the prompt. Any ideas or suggestions will be appreciated.

powershell script:
cd C:\AuthAPI\dist
forever start index.js | Write-Host

Hi,

Thanks for getting in touch.

That is strange. I’m not yet sure why the step doesn’t finish. Interestingly you can add more to your script after running forever and it will get executed.

You can work around the issue by starting forever in a new process:

Start-Process forever -ArgumentList 'start index.js'

Cheers,
Shane

Shane,
Your workaround resolved the issue. Thank you for the advice.

Chad