-
Notifications
You must be signed in to change notification settings - Fork 653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call to os.userInfo can lead to uncaught SystemError #4438
Comments
I'm surprised this is still a problem after all this time. I encountered the problem while trying to build a capacitor app using TeamCity. This is the stack trace documenting the exact problem
And this is the PR the avoids it allowing the build to be completed successfully: #4958 |
Well i found a way to make it work in my build after hours of testing different solutions. I just set up an env variable SHELL = {}. Not sure if it's the best solution but it works. |
But it seems this will still got the error, since it will always call os. userinfo? |
Description:
Somewhere during releases the following code has been introduced in a release:
53d0afa#diff-7c6997f05d0c3a730c4dd717afb61024
The problem I encounter is that in some cases the call to
os.userInfo();
can lead to aSystemError
if the username or homedirectory is not returned by the OS as described here: https://nodejs.org/api/os.html#os_os_userinfo_options For me this is the case when running the ionic-cli in a Docker container using the--user
parameter to specify a custom UID.Steps to Reproduce:
Run the command
npx ionic build --prod --verbose
inside a docker container using the--user
Docker argument to specify a specific UID.Output:
My
ionic info
:Command can not run due to the aforementioned error. This was tested with the @ionic/cli latest package and is reproducible from latest until version 5.4.7 where the code was introduced. Also the exception is thrown by all modern Node versions.
Possible solution:
As the method contains multiple methods of detecting a usable shell. It might be proficient to simply catch the exception and carry on using one of the following detection methods to determine the shell.
The text was updated successfully, but these errors were encountered: