Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

forever -c option problem on window os #140

Open
coconutperm opened this issue Feb 10, 2017 · 1 comment
Open

forever -c option problem on window os #140

coconutperm opened this issue Feb 10, 2017 · 1 comment

Comments

@coconutperm
Copy link

coconutperm commented Feb 10, 2017

Hello,

I try to run with nodemon and forever using -c option.
but, it occur ENOENT error to 'nodemon' using -c option.

So, I found a problem like below.
child-process module use win-bash script on window os.
it should use full file name to bash script like 'nodemon.cmd' if run some command.

So, I try to run with full command like 'forever start -c nodemon.cmd ./main.js'.
But It occur same error like below.

Error: spawn nodemon ENOENT
at exports._errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)

Finally I found a additional problem to monitor.js

  • monitor.js
    =======================================
    //
    // ### @Private {Object} safetyChecks
    // Define default safety checks for commands
    // with spaces in Windows & Linux
    //
    var safetyChecks = {
    windows: /(?:"(.[^\/])"|(\w+))(?:\s(.))?/, //<-- Regular expressions truncate characters below '.' char.
    linux: /(.?[^\\])(?: (.)|$)/
    };
    ====================================

So, I will fix regex and pull request.
Please review my request.

** Refer Window path: node_modules/.bin **
node_modules.bin\nodemon
node_modules.bin\nodemon.cmd

@romandev

@toficofi
Copy link
Contributor

toficofi commented Mar 8, 2017

This is caused by nodejs/node-v0.x-archive#2318
As a workaround, add spawnWith: {shell: true} to your config.

toficofi added a commit to toficofi/forever-monitor that referenced this issue Mar 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants