-
Notifications
You must be signed in to change notification settings - Fork 30k
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
stderr redirection breaks require #11257
Comments
Thanks for reporting this! Seems like some kind of circular dependency in the core module to me… |
The fs module requires internal/fs and internal/fs requires fs which causes a circular dependency. This change lazy loads fs inside of internal/fs to prevent assertEncoding from breaking when requiring via stdin. Fixes: nodejs#11257
Previously, there was a circular dependency on the public fs module in SyncWriteStream. Moving the implementations of fs.writeSync and fs.closeSync to internal/fs allows us to avoid that circular dependency. Fixes: nodejs#11257
nodejs/node#11257 Instead of piping the output to node, create a temporary file.
I have the same error. Running a python code on the background, which makes pipe to node. Something like this:
|
i have this error as well, so it is because of 8.5? |
I can not reproduce this from 8.4 on but I do not know what might have fixed it. @p3x-robot this is still occuring for you on 8.5? Do you have a minimal test case? |
Yes it is still error:
|
this is my error. |
I am using 8.5 |
@p3x-robot thanks a lot for that. I am still not sure what you executed though. Can you please show the exact used command and only that? |
for me it is working with 8.6 |
Hm weird. It would still be good to know what happened but I am closing this as it seems to be resolved. |
I am using node version |
@avatar-lavventura yes, using a newer version should resolve the problem. |
this is resolved in 8.11.1 LTS and in the current (10.0), I have verified it. So I guess this can be closed. |
ping @evanlucas |
@gireeshpunathil I’d guess that this was fixed by accident and we maybe want a regression test for it? |
this is fixed in the latest, and a regression test is added now through #20391 |
related workaround: rtfeldman/node-test-runner#106, rtfeldman/node-test-runner@959fda0
We noticed that when redirecting stderr AND receiving input script via pipe,
require
doesn't work with packages in package.json.Minimal test case: (given a
package.json
that includes ajv).expected output: nothing, it's just a require
actual output:
also tested on another Ubuntu 14.04 server. Was not a problem using node 6.9.5
The text was updated successfully, but these errors were encountered: