parcel: /bin/sh: lscpu: not found on Alpine Linux

🐛 bug report

Parcel works fine but gives lscpu: not found warning on Alpine Linux.

🎛 Configuration (.babelrc, package.json, cli command)

parcel index.html

{
    "presets": ["@babel/preset-env"]
}

🤔 Expected Behavior

There should be no warnings.

😯 Current Behavior

⠋ Building.../bin/sh: lscpu: not found

💁 Possible Solution

Use something more widespread than lscpu that will be available in Alpine Linux.

🔦 Context

Parcel works fine, not sure whether it affects me in any practical way.

💻 Code Sample

🌍 Your Environment

Software Version(s)
Parcel 1.10.0-beta.1
Node 10.10.0
npm/Yarn 6.4.1
Operating System Alpine Linux

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 7
  • Comments: 17 (3 by maintainers)

Most upvoted comments

@DeMoorJasper I think it worth adjusting this error with message like:

Building…/bin/sh: [Warning] lscpu: not found. “os.cpus” fallback used instead

So that user will not get confused with that and won’t go and post yet another issue on Github.

for the n00bs among us, can you please let us know where we’re supposed to set the

it’s just an environment variable, on linux/macos you can do PARCEL_WORKERS=1 parcel build src/index.html

I agree a warning would be way more user friendly.

Another workaround that hasn’t been mentioned here but I’ll add it for reference: if you know what the cpu count is on your machine you can set the environment variable PARCEL_WORKERS to that amount or just PARCEL_WORKERS=1 as a safe option. If this is set, then Parcel doesn’t try to detect the cpu count itself and it will never attempt to run lscpu. Here it is in the docs.

@DeMoorJasper

From the console output, we cannot tell whether it’s an error or warning. It makes me nervous when I see this (I was building a docker image).

Is there anything working differently when it falls back to os.cpus? If not, I think there’s no need to show even a warning.

I see the issue is closed. Does that mean you’re not planning to make this warning any way friendlier that it is now?

This warning comes from a dependency and not Parcel itself.

What I would do is keep this issue open until you have time to make the log friendlier / swap lscpu with some other stuff / etc.

Agree. Actually, I just saw that #2555 is also open and contains more technical discussion/possible changes.

@louh your error is not /bin/sh: lscpu: not found. That’s harmless. Your error is Can't read /app/browserslist config.