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

In chroot environments, npm run build fails #2110

Closed
vielhuber opened this issue Aug 8, 2018 · 0 comments
Closed

In chroot environments, npm run build fails #2110

vielhuber opened this issue Aug 8, 2018 · 0 comments
Labels

Comments

@vielhuber
Copy link

Version

3.0.0-rc.11

Node and OS info

Node 10.8.0 / npm 6.2.0 / Ubuntu 16 64-bit

Steps to reproduce

In a chroot environment, where /proc etc. is not available, require('os').cpus() returns undefined.

If we run npm run build, we get the following error:

ERROR TypeError: Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
at exports.defaults (/xxx/node_modules/@vue/cli-service/lib/options.js:77:33)

If we change the line 77 of options.js to

parallel: require('os').cpus() !== undefined && require('os').cpus().length > 1,

it works.

There is only another small error in uglifyjs-webpack-plugin (where again some kind of cpu function is used without checking if it returns undefined), but I will open up another support ticket there.

Can you please improve this line of code?

What is expected?

Normal build process

What is actually happening?

Error in options.js line 77.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants