Skip to content

Conversation

@kamwoods
Copy link
Member

Replace username package with native os.userInfo()

The username package (v7.0.0) is ESM-only and depends on execa, which causes bundling issues with @yao-pkg/pkg when building the standalone executable. The execa dependency was not being included in the pkg snapshot filesystem, resulting in:

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'execa'

Since username was only used to get the current user as a fallback when SUDO_USER is not set, replace it with Node's built-in os.userInfo().username which provides the same functionality without external dependencies.

Preliminary (testing) support for 26.04LTS (Resolute). Only for use in development testing with daily builds.

Replace username package with native os.userInfo()

The username package (v7.0.0) is ESM-only and depends on execa,
which causes bundling issues with @yao-pkg/pkg when building the
standalone executable. The execa dependency was not being included
in the pkg snapshot filesystem, resulting in:

  Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'execa'

Since username was only used to get the current user as a fallback
when SUDO_USER is not set, replace it with Node's built-in
os.userInfo().username which provides the same functionality
without external dependencies.

Preliminary (testing) support for 26.04LTS (Resolute). Only
for use in development testing with daily builds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants