Closed DSpeckhals closed 9 years ago
After digging into why the require call was failing outside of the multitask, I found that the error is caused by Grunt running the requirejs
task in the Atom environment. Specifically, r.js detects Atom as a browser, rather than Node. I opened an issue at jrburke/r.js#840 to track this.
Yes, I guess you could move the import of requirejs into the multitask, but this seems to go against typical Grunt task practices. For now, though, I believe that this can be closed.
I have started to dabble around with Github's Atom text editor, and have run into a consistent problem when attempting to execute this task with Atom's grunt-runner package on Windows 7 (problem reproduced on two different machines). The error states:
EBADF: bad file descriptor, write
, which seems to be a file permissions issue within node. However, I decided to test the grunt-requirejs task instead, and it ran normally. After a lot of tinkering, I found out that this exception is specifically being thrown in tasks/requirejs.js while try to require the actual requirejs module. I noticed that this action is executed outside of the multitask sonode/print
can be defined.The interesting thing is that if I move this block of code inside of the multitask (so it is executed with the actual task, instead of during the registration of the task), everything runs as expected without errors.
I'm not sure if this is the proper long term solution for this, but my question is why are low-level file permission errors being thrown here. Just as a note, I tested this grunt task on the command line and within a different text-editor, and it was fine there too.
I am using Grunt 0.4.5, with grunt-contrib-requirejs 0.4.4.