Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Regression: osenv.home() crashes in environments where there is no home #14

Open
kentonv opened this issue Mar 4, 2017 · 0 comments
Open

Comments

@kentonv
Copy link

kentonv commented Mar 4, 2017

Before the change to use os-homedir, osenv.home() would return undefined in cases where HOME is not set.

After the change, home() throws an exception if it can't find a suitable home directory. This in turn means that importing the npm module at all fails, since it calls home() during startup.

This breaks things in environments like stripped-down containers where there is no home directory.

(I realize this change was made a long time ago, but a dependency of mine recently updated what version of the npm library it uses, suddenly causing these crashes.)

For now I am setting a dummy HOME in my environment, but this could have other side effects, so gracefully handling the lack of a home directory would be preferable.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant