Skip to content

In chroot environments, npm run build fails #2110

Closed
@vielhuber

Description

@vielhuber

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions