You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, my hosting is in a virtual machine with ISP config, I access through a limited shell (Jailkit) that has node/npm enabled.
When I try to use a library that checks the number of CPUs, it returns undefined, when in the documentation it says that it should always return an array (even if it is an empty array).
This causes errors with all the modules that use os.cpus(), I verified that they fail with mozjpeg and uglify.
> @ production /web
> cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
/web/node_modules/uglifyjs-webpack-plugin/dist/uglify/index.js:54
this.maxConcurrentWorkers = parallel === true ? _os2.default.cpus().length - 1 : Math.min(Number(parallel) || 0, _os2.default.cpus().length - 1);
^
TypeError: Cannot read property 'length' of undefined
at new _class (/web/node_modules/uglifyjs-webpack-plugin/dist/uglify/index.js:54:137)
at Compilation.<anonymous> (/web/node_modules/uglifyjs-webpack-plugin/dist/index.js:119:24)
at Compilation.applyPluginsAsyncSeries (/web/node_modules/tapable/lib/Tapable.js:206:13)
at applyPluginsAsync.err (/web/node_modules/webpack/lib/Compilation.js:663:10)
at Compilation.applyPluginsAsyncSeries (/web/node_modules/tapable/lib/Tapable.js:195:46)
at applyPluginsAsyncSeries (/web/node_modules/webpack/lib/Compilation.js:659:9)
at Compilation.applyPluginsAsyncSeries (/web/node_modules/tapable/lib/Tapable.js:195:46)
at Compilation.seal (/web/node_modules/webpack/lib/Compilation.js:602:8)
at applyPluginsParallel.err (/web/node_modules/webpack/lib/Compiler.js:504:17)
at /web/node_modules/tapable/lib/Tapable.js:289:11
at _addModuleChain (/web/node_modules/webpack/lib/Compilation.js:505:11)
at processModuleDependencies.err (/web/node_modules/webpack/lib/Compilation.js:475:14)
at process._tickCallback (internal/process/next_tick.js:112:11)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ production: `cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ production script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Proposed solution: os.cpus() should return an empty array if it cannot have access to CPU information.
The text was updated successfully, but these errors were encountered:
bnoordhuis
added
duplicate
Issues and PRs that are duplicates of other issues or PRs.
os
Issues and PRs related to the os subsystem.
labels
Mar 8, 2018
Hi, my hosting is in a virtual machine with ISP config, I access through a limited shell (Jailkit) that has node/npm enabled.
When I try to use a library that checks the number of CPUs, it returns undefined, when in the documentation it says that it should always return an array (even if it is an empty array).
This causes errors with all the modules that use os.cpus(), I verified that they fail with mozjpeg and uglify.
Proposed solution: os.cpus() should return an empty array if it cannot have access to CPU information.
The text was updated successfully, but these errors were encountered: