Skip to content
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

os.cpus() returns empty array. #38190

Closed
ghost opened this issue Apr 10, 2021 · 4 comments
Closed

os.cpus() returns empty array. #38190

ghost opened this issue Apr 10, 2021 · 4 comments
Labels
android Issues and PRs related to the android platform. libuv Issues and PRs related to the libuv dependency or the uv binding. os Issues and PRs related to the os subsystem.

Comments

@ghost
Copy link

ghost commented Apr 10, 2021

What steps will reproduce the bug?

const os = require("os");
console.log(os.cpus());

How often does it reproduce? Is there a required condition?

it happens whenever I run os.cpus()

What is the expected behavior?

it is supposed to print an Array of the CPUs of the phone.

What do you see instead?

I see an empty Array [] instead.

Additional Information

I made an web app that shows system information in the browser, it works on my pc but never worked on this device.

@Ayase-252 Ayase-252 added android Issues and PRs related to the android platform. os Issues and PRs related to the os subsystem. labels Apr 11, 2021
@Linkgoron
Copy link
Member

Linkgoron commented Apr 11, 2021

I think that this issue was also discussed here: #19022

@benjamingr
Copy link
Member

Android is self-serve.

Android is not a supported platform. Patches to improve the Android build are welcome. There is no testing on Android in the current continuous integration environment. The participation of people dedicated and determined to improve Android building, testing, and support is encouraged.

As mention in the issue Nitzan linked to above - I suggested 2-3 workarounds for this ( #19022 (comment) ) - you are welcome to use either or (even better) open a PR

@juanarbol juanarbol added the libuv Issues and PRs related to the libuv dependency or the uv binding. label Apr 13, 2021
@EladKeyshawn
Copy link

Android is self-serve.

Android is not a supported platform. Patches to improve the Android build are welcome. There is no testing on Android in the current continuous integration environment. The participation of people dedicated and determined to improve Android building, testing, and support is encouraged.

As mention in the issue Nitzan linked to above - I suggested 2-3 workarounds for this ( #19022 (comment) ) - you are welcome to use either or (even better) open a PR

Is a PR in libuv code should be in libuv repo directly? Or can be done here ?

@benjamingr
Copy link
Member

Is a PR in libuv code should be in libuv repo directly? Or can be done here ?

In the libuv repo :)

@ghost ghost closed this as completed Apr 28, 2021
novemberborn added a commit to avajs/ava that referenced this issue Aug 27, 2022
`os.cpus()` can return empty arrays on platforms not officially supported by Node.js. Use 1 as a minimum.

See <nodejs/node#38190>.

Co-authored-by: Mark Wubben <mark@novemberborn.net>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Issues and PRs related to the android platform. libuv Issues and PRs related to the libuv dependency or the uv binding. os Issues and PRs related to the os subsystem.
Projects
None yet
Development

No branches or pull requests

5 participants