You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 1, 2020. It is now read-only.
Repository navigation
This repository was archived by the owner on May 1, 2020. It is now read-only.
$ gulp
[12:05:33] Using gulpfile ~\Documents\Purescript\gulpfile.js
[12:05:33] Starting 'purescript'...
events.js:85
throw er; // Unhandled 'error' event
^
Error: spawn psc ENOENT
at exports._errnoException (util.js:746:11)
at Process.ChildProcess._handle.onexit (child_process.js:1046:32)
at child_process.js:1137:20
at process._tickCallback (node.js:355:11)
//gulpfile.jsvargulp=require('gulp');varpurescript=require('gulp-purescript');gulp.task('purescript',function(){returngulp.src('src/**/*.purs').pipe(purescript.psc({main:"Chapter2"})).//<-- if this line is commented the script workspipe(gulp.dest('build'));});gulp.task('default',['purescript']);
-- Chapter2.pursmoduleChapter2whereimportDebug.Trace
main = trace "Hello"
$ node -v
v0.12.1
$ npm -v
2.5.1
$ gulp -v
[12:05:49] CLI version 3.8.11
[12:05:49] Local version 3.8.11
Would you possibly be able to try this module locally to see if it solves the problem (without adding the .cmd extension)? Sorry that I can't give this a go myself. I don't have access to windows at all.
Not sure if this is the best way to go, but might be worth a try.
// node_modules\gulp-purescript\index.js line:2196functionspawnFn(command,args,errback,callback){command=command+".cmd";//<-- added this linereturnfunction(){//var child_process = __webpack_require__(35);//var process = child_process.spawn(command, args);console.log(command);varprocess=require('cross-spawn')(command,args);//<-- added this line
...
results in the same as in previous attempt: gulp works but purescript.psc(options)options is not respected.
Did you happen to try it without adding the .cmd to command? I.e., removing:
command=command+".cmd";//<-- added this line
So it would be
// node_modules\gulp-purescript\index.js line:2196functionspawnFn(command,args,errback,callback){returnfunction(){//var child_process = __webpack_require__(35);//var process = child_process.spawn(command, args);varprocess=require('cross-spawn')(command,args);//<-- added this line
...
If this does not work as well, what are the options passed to psc? Can you please provide the values of command and args?
Ah, no worries. Thanks for the info. Just for good measure, would you mind console.log-ing the command and args variables and providing the output? I.e., the precise values passed to cross-spawn.
Interesting. The value of args looks to be missing your options passed to psc in the gulpfile.
Perhaps cross-spawn is working properly, but somewhere outside of spawnFn the options are getting lost. I will look into this further, but if you have a chance to trace back the args value a bit to see where they might be getting lost, it would be a great help!
What version of gulp-purescript are you on? Can you please try this with 0.4.2?
There was a previous fix (#24) for parsing the psc main option. Maybe an update will solve the options issue. If so, I can migrate to using cross-spawn.
And the way you traced is how I would have done it. Not sure if there is a better way.
Error: Error in module Chapter2:
Error at C:\Users\john\Documents\Purescript\src\Chapter2.purs line 3, column 1 - line 5, column 1:
Unknown module Debug.Trace
Switching to non-cross-spawn brings ENOENT back. So ENOENT issue is resolved.
To clarify, when cross-spawn is not being used (i.e., vanilla gulp-purescript @ 0.4.2), do you still get the ENOENT error? Given that you are using the options:
I have just tried installing purescript-angular from scratch and after following the steps I got the same error as mentioned at the beginning of this article. I have Node 4.2.1 and npm 2.14.7 . I have tried changing
"gulp-purescript": "0.1.2",
to
"gulp-purescript": "*",
but then i got
[14:55:01] Warning: gulp version mismatch:
[14:55:01] Global gulp is 3.9.0
[14:55:01] Local gulp is 3.8.10
[14:55:02] Using gulpfile ~\Desktop\purescript-angular\gulpfile.js
[14:55:02] Starting 'clean'...
[14:55:02] Finished 'clean' after 25 ms
[14:55:02] Starting 'todomvc'...
[14:55:02] 'todomvc' errored after 11 ms
[14:55:02] Error in plugin 'gulp-purescript'
Message:
Type mismatch: expected array, found Undefined
@DominikDitoIvosevic would you be able to verify the version of gulp-purescript you have installed? Also, have you tried to match your local gulp with your global gulp version?
Activity
ethul commentedon May 11, 2015
Thanks for the report. I haven't tried the library with node 0.12.x. I will take a look.
garyb commentedon May 11, 2015
I'm using node 0.12.2 so I'm not necessarily sure it's related to that.
@JohnGurin what do you get for
where psc?JohnGurin commentedon May 11, 2015
@garyb
ethul commentedon May 11, 2015
Could the issue be:
https://github.com/npm/npm/wiki/Troubleshooting#error-enoent-stat-cusersuserappdataroamingnpm-on-windows-7
JohnGurin commentedon May 20, 2015
So, I think I found the problem. http://stackoverflow.com/a/17537559
Made the gulp-purescript work by adding
Now the gulp compiles
*.purstopsc.jsignoring optionsethul commentedon May 24, 2015
@JohnGurin thanks for digging into this.
I wonder if we are running into nodejs/node-v0.x-archive#2318
From that thread, it looks like one solution is to drop-in the following replacement for spawn.
https://github.com/IndigoUnited/node-cross-spawn
Would you possibly be able to try this module locally to see if it solves the problem (without adding the
.cmdextension)? Sorry that I can't give this a go myself. I don't have access to windows at all.Not sure if this is the best way to go, but might be worth a try.
JohnGurin commentedon May 27, 2015
results in the same as in previous attempt: gulp works but
purescript.psc(options)optionsis not respected.ethul commentedon May 27, 2015
Thanks for giving this a try @JohnGurin
Did you happen to try it without adding the
.cmdtocommand? I.e., removing:So it would be
If this does not work as well, what are the options passed to
psc? Can you please provide the values ofcommandandargs?Thanks for all of this!
JohnGurin commentedon May 27, 2015
Sorry, I tested without
command = command + ".cmd";, copy pasted it from previous message and missed the line.console.log(command)printspscethul commentedon May 27, 2015
Ah, no worries. Thanks for the info. Just for good measure, would you mind
console.log-ing thecommandandargsvariables and providing the output? I.e., the precise values passed tocross-spawn.Thanks!
JohnGurin commentedon May 27, 2015
ethul commentedon May 27, 2015
Interesting. The value of
argslooks to be missing your options passed to psc in the gulpfile.Perhaps
cross-spawnis working properly, but somewhere outside ofspawnFnthe options are getting lost. I will look into this further, but if you have a chance to trace back the args value a bit to see where they might be getting lost, it would be a great help!JohnGurin commentedon May 27, 2015
btw, what is the right way to traceback nodejs?
ethul commentedon May 27, 2015
Thanks!
What version of
gulp-purescriptare you on? Can you please try this with0.4.2?There was a previous fix (#24) for parsing the psc main option. Maybe an update will solve the options issue. If so, I can migrate to using
cross-spawn.And the way you traced is how I would have done it. Not sure if there is a better way.
3 remaining items
JohnGurin commentedon May 27, 2015
Oops.
noPrelude:trueis the cause.Everything works
purescript.psc({main:"Chapter2",module:["Chapter2"]})ethul commentedon May 27, 2015
@JohnGurin Just to confirm, having
noPrelude:truewas causing theENOENTerror?Glad it works now by the way!
JohnGurin commentedon May 27, 2015
No, only
Switching to non-cross-spawn brings
ENOENTback. SoENOENTissue is resolved.ethul commentedon May 28, 2015
To clarify, when
cross-spawnis not being used (i.e., vanillagulp-purescript @ 0.4.2), do you still get theENOENTerror? Given that you are using the options:Thanks!
JohnGurin commentedon May 28, 2015
Yes
ethul commentedon May 28, 2015
Thanks. I will reopen the issue and add cross-spawn.
Using cross-spawn as a drop-in for child_process
Using cross-spawn as a drop-in for child_process
ethul commentedon May 29, 2015
Released in version
0.4.3. Please let me know if it works for you.Thanks!
JohnGurin commentedon May 29, 2015
👍
doivosevic commentedon Dec 2, 2015
I have just tried installing purescript-angular from scratch and after following the steps I got the same error as mentioned at the beginning of this article. I have Node 4.2.1 and npm 2.14.7 . I have tried changing
to
but then i got
ethul commentedon Dec 2, 2015
@DominikDitoIvosevic would you be able to verify the version of
gulp-purescriptyou have installed? Also, have you tried to match your localgulpwith your globalgulpversion?