Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Aug 11, 2021. It is now read-only.
This repository was 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

@kentonv

Description

@kentonv

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions