[Bug 221762] www/node: undefined require('os').cpus() on aarch64
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Thu Aug 24 12:49:21 UTC 2017
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221762
Bug ID: 221762
Summary: www/node: undefined require('os').cpus() on aarch64
Product: Ports & Packages
Version: Latest
Hardware: arm64
OS: Any
Status: New
Severity: Affects Many People
Priority: ---
Component: Individual Port(s)
Assignee: bhughes at freebsd.org
Reporter: gergely.czuczy at harmless.hu
Assignee: bhughes at freebsd.org
Flags: maintainer-feedback?(bhughes at freebsd.org)
Hello,
I've installed npm on an aarch64, -CURRENT, and whatever i'm trying to install,
i'm always getting the following:
root at aegir:~# npm install -g @angular/cli
npm ERR! Cannot read property 'length' of undefined
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2017-08-23T19_50_05_510Z-debug.log
root at aegir:~# less /root/.npm/_logs/2017-08-23T19_50_05_510Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli '@angular/cli' ]
2 info using npm at 5.3.0
3 info using node at v8.4.0
4 verbose npm-session 5c14726b0422cde1
5 verbose stack TypeError: Cannot read property 'length' of undefined
5 verbose stack at Object.<anonymous>
(/usr/local/lib/node_modules/npm/node_modules/worker-farm/lib/farm.js:5:61)
5 verbose stack at Module._compile (module.js:573:30)
5 verbose stack at Object.Module._extensions..js (module.js:584:10)
5 verbose stack at Module.load (module.js:507:32)
5 verbose stack at tryModuleLoad (module.js:470:12)
5 verbose stack at Function.Module._load (module.js:462:3)
5 verbose stack at Module.require (module.js:517:17)
5 verbose stack at require (internal/module.js:11:18)
5 verbose stack at Object.<anonymous>
(/usr/local/lib/node_modules/npm/node_modules/worker-farm/lib/index.js:3:14)
5 verbose stack at Module._compile (module.js:573:30)
5 verbose stack at Object.Module._extensions..js (module.js:584:10)
5 verbose stack at Module.load (module.js:507:32)
5 verbose stack at tryModuleLoad (module.js:470:12)
5 verbose stack at Function.Module._load (module.js:462:3)
5 verbose stack at Module.require (module.js:517:17)
5 verbose stack at require (internal/module.js:11:18)
6 verbose cwd /root
7 verbose FreeBSD 12.0-CURRENT
8 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g"
"@angular/cli"
9 verbose node v8.4.0
10 verbose npm v5.3.0
11 error Cannot read property 'length' of undefined
12 verbose exit [ 1, true ]
Apparently
/usr/local/lib/node_modules/npm/node_modules/worker-farm/lib/farm.js:5 is the
culprit:
const DEFAULT_OPTIONS = {
maxCallsPerWorker : Infinity
, maxConcurrentWorkers : require('os').cpus().length
, maxConcurrentCallsPerWorker : 10
, maxConcurrentCalls : Infinity
, maxCallTime : Infinity // exceed this and the whole
worker is terminated
, maxRetries : Infinity
, forcedKillTime : 100
, autoStart : false
Apparently that require('os').cpus().length is the problem, length is undefined
here. Personally I've replaced it with a 4, as my cpucount is, however it's not
a universal generic workaround.
After a suggestion from sunpoet@, the culprit appears to be node:
$ node
> require('os').cpus().length
TypeError: Cannot read property 'length' of undefined
at repl:1:21
at ContextifyScript.Script.runInThisContext (vm.js:44:33)
at REPLServer.defaultEval (repl.js:239:29)
at bound (domain.js:301:14)
at REPLServer.runBound [as eval] (domain.js:314:12)
at REPLServer.onLine (repl.js:440:10)
at emitOne (events.js:120:20)
at REPLServer.emit (events.js:210:7)
at REPLServer.Interface._onLine (readline.js:279:10)
at REPLServer.Interface._line (readline.js:626:8)
> require('os').cpus()
undefined
> aegir at aegir:~/aegir/aegir-ui$ uname -a
FreeBSD aegir 12.0-CURRENT FreeBSD 12.0-CURRENT #0 r322723M: Tue Aug 22
19:13:29 CEST 2017
toor at marvin.harmless.hu:/tank/rpi3/crochet/work.aegir/obj/arm64.aarch64/tank/rpi3/src/sys/AEGIR
arm64
Could someone please look into it?
Thanks,
Gergely
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-ports-bugs
mailing list