Original issue opened here: sindresorhus/username#21
It turns out that running a script with docker run with --user flag set, then user actually has no $HOME or username. This in turn causes following error: uv_os_get_passwd returned ENOENT (no such file or directory) if os.userInfo() is accessed.
Some people have resorted to try catch blocks:
https://github.com/moleculerjs/moleculer/pull/396/files#diff-38423b3db1f1c2a43666c7ad898ba126R45
But is is not documented that os.userInfo() ever throws - https://nodejs.org/dist/latest-v10.x/docs/api/os.html#os_os_userinfo_options
- Version: v8, v10
- Platform: Linux, Docker container
Original issue opened here: sindresorhus/username#21
It turns out that running a script with
docker runwith--userflag set, then user actually has no$HOMEorusername. This in turn causes following error:uv_os_get_passwd returned ENOENT (no such file or directory)ifos.userInfo()is accessed.Some people have resorted to try catch blocks:
https://github.com/moleculerjs/moleculer/pull/396/files#diff-38423b3db1f1c2a43666c7ad898ba126R45
But is is not documented that
os.userInfo()ever throws - https://nodejs.org/dist/latest-v10.x/docs/api/os.html#os_os_userinfo_options