Closed johngeorgewright closed 9 years ago
As far as I can tell, the env
should be an object, not string. You can check the readme.
I know the last update was not compatible, but I don't know how to warn or make it clear for you guys. Any ideas?
Just do a major release. Then we won't get the update unless we do it manually.
Just tried changing it to an object and also tried removing the argument all together. Just can't get it to work :(
I'll keep trying.
If you like, you can post your gulpfile.js here, and I'll try to be of any help.
I'm getting the same ENOENT error as @johngeorgewright, and unable to get it to run the server at all.
Here is my gulpfile.js:
var gulp = require('gulp');
var server = require('gulp-express');
gulp.task('serve', function() {
server.run(['test/harness.js']);
});
And here are my versions:
"devDependencies": {
"connect-livereload": "^0.5.3",
"gulp": "^3.8.10",
"gulp-express": "^0.1.8",
"gulp-mocha": "^2.0.0",
"mocha": "~1.13.0",
"should": "~4.3.1"
},
I'm using Node 10.33.
This also occurred on my machine. I downgraded to 0.1.7
in order to get it running again.
@azhawkes could you please help to check if you can run node
in your terminal?
Gyus, sorry for the inconvenience, but I couldn't reproduce the problem yet.
I've google "spawn ENOEOT" around, it might be that node
is somehow not available, could you please try to verify this, or do a sudo
execution of the gulp serve.
Thanks for your feedback, and I'll keep an close eye on this, and continue searching.
There is a error only with the version 0.1.8. When I rolled back to 0.1.7 it works fine.
@gimm Yeah, I can run node normally in my terminal and all that. It's at /usr/local/bin/node and is version 10.33. Are you running Node 12.x by chance?
Could anyone give me the gulpfile.js and the app.js? so I can try to reproduce the problem here. I couldn't get this issue locally, I'm running node 10.36 on win7.
Now I removed this SIGINT listener in v0.1.9:
//process.on('SIGINT', mainDownListener);
please update to 0.1.9 to see if this was fixed. Thanks a lot!
The same still happening for me on 0.1.9. Even using the examples you have on the README.md.
Service process exited with [code => 1 | sig => undefined]
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:1000:11)
at Process.ChildProcess._handle.onexit (child_process.js:791:34)
Could anyone send me the copy of your project so that I can check and find the reason? appreciate that.
And if there's not too much trouble, I'd like to ask you to help verify this spawn ENOENT
error is introuduce by gulp-express, by runing node app.js
and refresh your browser.
As I just reviewed one project, turns out the spawn error is caused by node-compass.
I have the same Service process exited with [code => 1 | sig => undefined]
error after moving from 0.1.7 to 0.1.9.
Cannot give you link to the repo (it's private) but here is the code https://gist.github.com/varya/90d8ce39f6f402e941ce
@varya Thanks for your feedback. I've tried your code locally, works fine for me, with livereload.
Could you please try to check if the spawn error
was introduced by gulp-express
?
mmm just a lot of folks :) same issue with the last version :( if you want to try https://github.com/whisher/rock-paper-scissors-multiplayer
Hey there. I looked at the latest commits and I found that having moved the env options from process to child_process.spawn broke the thing. I'm no expert so I'm not sure about what those changes were for. @gimm, would you please check your changes in commit#5834d4b?
@whisher your project is not so simple, I didn't go through it yet. @willywongi commit#5834d4b was aimed to open up the flexibility of the arguments for child_process.spawn, I won't believe this change broke the thing.
@whisher you app works for me, with livereload, no errors.
@gimm Sorry to bother you but in my localhost doesn't work yet.What's your node version ?
@gimm,
I created a stub project to demonstrate the problem https://github.com/varya/gulp-express-stub
In the master branch the is a working example based on 0.1.7
. Type gulp
to run it.
Another branch based on 0.1.9
does not work https://github.com/varya/gulp-express-stub/tree/update-gulp-express
This is the output when running the broken version
Service process exited with [code => 1 | sig => undefined]
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:1011:11)
at Process.ChildProcess._handle.onexit (child_process.js:802:34)
Others, if you can confirm that 0.1.9
does not work in this simple project for you, please do.
In here you can see that the only difference between branches is switching to a new version and API change of server.run
method. https://github.com/varya/gulp-express-stub/pull/1/files
My node version is 0.10.36.
The problem is with options parameter
like this
service = child_process.spawn('node', args);
works fine
http://stackoverflow.com/a/27716861/356380
this works for me
var env = Object.create( process.env );
env.NODE_ENV = 'development';
service = child_process.spawn('node', args, { env : env, port : 35729});
@whisher thanks, I have made changes to set a new default options like this:
defaults = {
args: ['app.js'],
options: {
cwd: undefined,
port: 35729
}
};
defaults.options.env = process.env;
defaults.options.env.NODE_ENV = 'development';
this should solve spawn ENOENT error here.
@varya I still can fire up your app without error, but I had updated the plugin, please give it a try, sorry for the trouble here.
@gimm yaw, thanks to you to share :)
Could you release 0.1.10 with this change? This should fix my case too.
new release is there already https://www.npmjs.com/package/gulp-express please let me know if this works for you thanks
Yes, this works, thank you!
I should go to bed now :smile: have a nice day
Hey there,
Just to warn you, you made a non backwards compatible API change in your last patch release... so beware of some issues opening up your way :wink: Certainly took me awhile to figure out what was going wrong.
Since the update I'm also getting spawn errors and I have no idea why.
Anything look incorrect?