Repository navigation
stderr redirection breaks require #11257
Copy link
Copy link
Closed
Labels
confirmed-bugIssues and PRs for confirmed bugs.Issues and PRs for confirmed bugs.fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.
Description
Activity
- addedconfirmed-bugIssues and PRs for confirmed bugs.Issues and PRs for confirmed bugs.fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.
on Feb 9, 2017 Thanks for reporting this! Seems like some kind of circular dependency in the core module to me…
Reacted by Michael Glass- added a commit that references this issue
on Mar 23, 2017 - added a commit that references this issue
on May 16, 2017 I have the same error. Running a python code on the background, which makes pipe to node.
nohup python hello.py &. Inside python code I just called a node script. Original code works withoutnohup.Something like this:
os.popen( val + "| node & echo $! >" + constants.LOG_PATH + "/my-app.pid").read().assertEncoding(options.encoding); ^ TypeError: assertEncoding is not a function at getOptions (fs.js:58:5) at Object.realpathSync (fs.js:1564:13) at toRealPath (module.js:130:13) at Function.Module._findPath (module.js:178:22) at Function.Module._resolveFilename (module.js:468:25) at Function.Module._load (module.js:418:25) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at [stdin]:1:13 at ContextifyScript.Script.runInThisContext (vm.js:23:33) fs.js:58Reacted by alper alimoglui 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:
Updating 4d3e58a..532812e Fast-forward package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 9878 root 1192 S grep fail2ban WAN DNS: 192.168.78.20 74.82.42.42 8.8.8.8 /opt/router-scripts-lede/settings/common/override/ /opt/router-scripts-lede/settings/d-link.router/override/ module.js:473 throw err; ^ TypeError: assertEncoding is not a function at getOptions (fs.js:81:5) at Object.realpathSync (fs.js:1584:15) at toRealPath (module.js:154:13) at Function.Module._findPath (module.js:203:22) at Function.Module._resolveFilename (module.js:525:25) at Function.Module._load (module.js:453:25) at Function.Module.runMain (module.js:665:10) at startup (bootstrap_node.js:201:16) at bootstrap_node.js:626:3 */5 * * * * /opt/router-scripts-lede/update-domains >>/var/log/update-domains.log 2>>/var/log/update-domains.error.log 10 3 * * * /opt/router-scripts-lede/daily >>/var/log/daily.log 2>>/var/log/daily.error.log 8 4 * * * /opt/router-scripts-lede/backup-daily >>/var/log/backup-daily.log 2>>/var/log/backup-daily.error.log 6 5 * * 0 /opt/router-scripts-lede/backup-weekly >>/var/log/backup-weekly.log 2>>/var/log/backup-weekly.error.log 5 6 1 * * /opt/router-scripts-lede/backup-monthly >>/var/log/backup-monthly.log 2>>/var/log/backup-monthly.error.log 9 * * * * /opt/router-scripts-lede/cron-fail2ban-check >>/var/log/fail2ban-check.log 2>>/var/log/fail2ban-check.error.logthis is my error.
12 remaining items
- added a commit that references this issue
on May 10, 2018 - added a commit that references this issue
on May 12, 2018 this is fixed in the latest, and a regression test is added now through #20391
Metadata
Metadata
Assignees
Labels
confirmed-bugIssues and PRs for confirmed bugs.Issues and PRs for confirmed bugs.fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.
related workaround: rtfeldman/node-test-runner#106, rtfeldman/node-test-runner@959fda0
We noticed that when redirecting stderr AND receiving input script via pipe,
requiredoesn't work with packages in package.json.Minimal test case: (given a
package.jsonthat 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