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

Issues with installing any packages #19348

Closed
fr6nco opened this issue Mar 14, 2018 · 16 comments
Closed

Issues with installing any packages #19348

fr6nco opened this issue Mar 14, 2018 · 16 comments
Labels
npm Issues and PRs related to the npm client dependency or the npm registry.

Comments

@fr6nco
Copy link

fr6nco commented Mar 14, 2018

I cannot install anything on basically a fresh installation of ubuntu. The issue might be environment related, but I could not figure out what might have happened.

Looks like, the NPM install does not generate any DNS lookups (tested with tcpdump), so It is not able to resolve the nodejs registry and the installation fails.

Im attaching the output from the npm install.

ubuntu@dash-client3:~/headless-client$ npm install --verbose
npm info it worked if it ends with ok
npm verb cli [ '/usr/bin/node', '/usr/bin/npm', 'install', '--verbose' ]
npm info using npm@5.6.0
npm info using node@v9.8.0
npm verb npm-session 06fe1df4880f1fe8
npm info lifecycle headless-client@1.0.0~preinstall: headless-client@1.0.0
npm verb correctMkdir /home/ubuntu/.npm/_locks correctMkdir not in flight; initializing
npm verb lock using /home/ubuntu/.npm/_locks/staging-5cab7ba2f42ac9db.lock for /home/ubuntu/headless-client/node_modules/.staging
npm verb unlock done using /home/ubuntu/.npm/_locks/staging-5cab7ba2f42ac9db.lock for /home/ubuntu/headless-client/node_modules/.staging
npm WARN headless-client@1.0.0 No description

npm verb stack TypeError [ERR_INVALID_OPT_VALUE]: The value "4294967295" is invalid for option "family"
npm verb stack     at lookup (dns.js:129:11)
npm verb stack     at net.js:1071:5
npm verb stack     at defaultTriggerAsyncIdScope (internal/async_hooks.js:281:19)
npm verb stack     at lookupAndConnect (net.js:1070:3)
npm verb stack     at TLSSocket.Socket.connect (net.js:998:5)
npm verb stack     at Object.exports.connect (_tls_wrap.js:1134:12)
npm verb stack     at HttpsAgent.createConnection (https.js:122:22)
npm verb stack     at HttpsAgent.createSocket (/usr/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/lib/_http_agent.js:271:26)
npm verb stack     at HttpsAgent.createSocket (/usr/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/lib/agent.js:77:11)
npm verb stack     at HttpsAgent.addRequest (/usr/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/lib/_http_agent.js:240:10)
npm verb stack     at new ClientRequest (_http_client.js:262:16)
npm verb stack     at request (https.js:275:10)
npm verb stack     at fetch.Promise (/usr/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/src/index.js:54:17)
npm verb stack     at new Promise ()
npm verb stack     at fetch (/usr/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/src/index.js:41:10)
npm verb stack     at retry (/usr/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/index.js:332:14)
npm verb cwd /home/ubuntu/headless-client
npm verb Linux 4.4.0-116-generic
npm verb argv "/usr/bin/node" "/usr/bin/npm" "install" "--verbose"
npm verb node v9.8.0
npm verb npm  v5.6.0
npm ERR! code ERR_INVALID_OPT_VALUE
npm ERR! The value "4294967295" is invalid for option "family"
npm verb exit [ 1, true ]

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ubuntu/.npm/_logs/2018-03-14T14_29_49_256Z-debug.log

The platform is an Ubuntu 16.04

The error says 4294967295 is invalid for option "family"

DNS lookups do work in other apps like apt-get, etc and there is no HTTP or HTTPS proxy set up between the client and the registry.npmjs.org

uname -a:
Linux dash-client3 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Tomas

@mscdex
Copy link
Contributor

mscdex commented Mar 14, 2018

This should probably be posted to npm's issue tracker, but out of curiosity can you also post the output of NODE_DEBUG=net npm install --verbose ?

@mscdex
Copy link
Contributor

mscdex commented Mar 14, 2018

My guess though is that some module up the line is either passing an object like { family: -1, ... } to dns.lookup() or calling dns.lookup('somehost', -1, ...) and that -1 value is being cast to a 32-bit unsigned value (via family >>> 0 inside dns.lookup()), hence the large family value seen in the error message (the largest 32-bit unsigned value).

@watilde watilde added the npm Issues and PRs related to the npm client dependency or the npm registry. label Mar 15, 2018
@fr6nco
Copy link
Author

fr6nco commented Mar 16, 2018

Hi, meanwhile I've downgraded nodejs to an older version (6.x) and everything started working, so there must be some incompatibility issues between the giver version of ubuntu and the node version. I'll try to reproduce the issue and get the desired output messages in beginning of the next week.

@lundibundi
Copy link
Member

@fr6nco any progress on this one? Is it still happening?

@makamekm
Copy link

makamekm commented Aug 9, 2018

@lundibundi Yes, indeed!

@lundibundi
Copy link
Member

@makamekm do you have a similar issue? Could you post details of your issue (node version, OS, output of what @mscdex suggested)? Though as @mscdex said this should be an NPM issue and not node so you should probably report there.

@fr6nco
Copy link
Author

fr6nco commented Aug 9, 2018

@lundibundi Unfortunately I have no access anymore to the setup which produced this issue, so I'm not able to reproduce it right now.

@makamekm
Copy link

makamekm commented Aug 10, 2018

@lundibundi
It happens with all versions from 8.x up to 10.x. I use docker drone ci with the following setup (maven & node 6 works fine | The output is the same as above):

clone:
  default:
    image: plugins/git
    skip_verify: true

pipeline:
  restore-cache:
    image: drillster/drone-volume-cache
    restore: true
    mount:
      - /drone/.m2
      - ./frontend/node_modules
    volumes:
      - /tmp/cache:/cache

  dependency-frontend:
    image: node:10
    commands:
      - cd ./frontend
      - npm config set registry <MY REGISTRY>
# THE ERROR HAPPENS HERE
      - npm install

  dependency-backend:
    image: huippujanne/maven-awscli-3.3.9-jdk-8
    commands: mvn dependency:resolve -s=./.mvn/settings.xml -Dmaven.repo.local=/drone/.m2

  rebuild-cache:
    image: drillster/drone-volume-cache
    rebuild: true
    mount:
      - /drone/.m2
      - ./frontend/node_modules
    volumes:
      - /tmp/cache:/cache

  build-frontend:
    image: node:10
    commands:
      - cd ./frontend
      - npm run compile

  build-backend:
    image: huippujanne/maven-awscli-3.3.9-jdk-8
    commands: mvn clean install -DskipTests=true -s=./.mvn/settings.xml -Dmaven.repo.local=/drone/.m2

  test-frontend:
    image: node:10
    commands:
      - cd ./frontend
      - npm test

@lundibundi
Copy link
Member

@makamekm could you provide an output of the actual error (npm install --verbose) while omitting any private data?

@makamekm
Copy link

@lundibundi sure
.drone.yml

clone:
  default:
    image: plugins/git
    skip_verify: true

pipeline:
  restore-cache:
    image: drillster/drone-volume-cache
    restore: true
    mount:
      - ./.m2
      - ./frontend/node_modules
    volumes:
      - /tmp/cache:/cache

  dependency-frontend:
    image: node:10
    commands:
      - cd ./frontend
      - npm config set proxy <MY PROXY>
      - npm config set http-proxy <MY PROXY>
      - npm config set https-proxy <MY PROXY>
# Or with a private registry
#      - npm config set registry <MY REGISTRY>
# ERROR HAPPENS HERE
      - npm install

  dependency-build-backend:
    image: huippujanne/maven-awscli-3.3.9-jdk-8
    commands: mvn clean install -DskipTests=true -s=./.mvn/settings.xml -Dmaven.repo.local=./.m2

  rebuild-cache:
    image: drillster/drone-volume-cache
    rebuild: true
    mount:
      - ./.m2
      - ./frontend/node_modules
    volumes:
      - /tmp/cache:/cache

  build-frontend:
    image: node:10
    commands:
      - cd ./frontend
      - npm run compile

  test-frontend:
    image: node:10
    commands:
      - cd ./frontend
      - npm test

branches: [ master, frontend, service, droneci ]

LOGS

+ cd ./frontend
+ npm config set proxy <MY PROXY>
+ npm config set http-proxy <MY PROXY>
+ npm config set https-proxy <MY PROXY>
+ npm install --verbose
npm info it worked if it ends with ok
npm verb cli [ '/usr/local/bin/node',
npm verb cli   '/usr/local/bin/npm',
npm verb cli   'install',
npm verb cli   '--verbose' ]
npm info using npm@6.2.0
npm info using node@v10.8.0
npm verb npm-session 4660f6874cfef636
npm info lifecycle frontend@0.0.1~preinstall: frontend@0.0.1
npm timing stage:loadCurrentTree Completed in 651ms
npm timing stage:loadIdealTree:cloneCurrentTree Completed in 29ms
npm timing stage:loadIdealTree:loadShrinkwrap Completed in 261ms
npm timing stage:rollbackFailedOptional Completed in 17ms
npm timing stage:runTopLevelLifecycles Completed in 17094ms
npm verb type system
npm verb stack FetchError: request to https://registry.npmjs.org/@babel%2fcore failed, reason: The value "4294967295" is invalid for option "family"
npm verb stack     at ClientRequest.req.on.err (/usr/local/lib/node_modules/npm/node_modules/node-fetch-npm/src/index.js:68:14)
npm verb stack     at ClientRequest.emit (events.js:182:13)
npm verb stack     at onerror (/usr/local/lib/node_modules/npm/node_modules/agent-base/index.js:100:9)
npm verb stack     at callbackError (/usr/local/lib/node_modules/npm/node_modules/agent-base/index.js:122:5)
npm verb cwd /drone/src/github.ldn.swissbank.com/AA25783-BOA/boa/frontend
npm verb Linux 4.9.93-boot2docker
npm verb argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--verbose"
npm verb node v10.8.0
npm verb npm  v6.2.0
npm ERR! code ERR_INVALID_OPT_VALUE
npm ERR! errno ERR_INVALID_OPT_VALUE
npm ERR! request to https://registry.npmjs.org/@babel%2fcore failed, reason: The value "4294967295" is invalid for option "family"
npm verb exit [ 1, true ]
npm timing npm Completed in 39334ms

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-08-10T15_59_33_922Z-debug.log

With node:6 | 7 it works correctly.

@apapirovski
Copy link
Member

Seems like an npm issue. Not sure this is the right place for this to be resolved.

@lsyeyexpo
Copy link

I also have this problem.My os was started in proxmox5.3.8,the os verison is CentOS Linux release 7.6.1810 (Core)
output:
`npm info it worked if it ends with ok
npm verb cli [ '/root/.nvm/versions/node/v10.14.1/bin/node',
npm verb cli '/root/.nvm/versions/node/v10.14.1/bin/npm',
npm verb cli 'install',
npm verb cli '--verbose' ]
npm info using npm@6.4.1
npm info using node@v10.14.1
npm verb npm-session 53faaab03c70b2e5
npm info lifecycle app@0.0.1~preinstall: app@0.0.1
npm timing stage:loadCurrentTree Completed in 244ms
npm timing stage:loadIdealTree:cloneCurrentTree Completed in 3ms
npm timing stage:loadIdealTree:loadShrinkwrap Completed in 105ms
npm timing stage:rollbackFailedOptional Completed in 4ms
npm timing stage:runTopLevelLifecycles Completed in 8533ms
npm verb stack TypeError [ERR_INVALID_OPT_VALUE]: The value "4294967295" is invalid for option "family"
npm verb stack at lookup (dns.js:113:11)
npm verb stack at net.js:1006:5
npm verb stack at defaultTriggerAsyncIdScope (internal/async_hooks.js:294:19)
npm verb stack at lookupAndConnect (net.js:1005:3)
npm verb stack at TLSSocket.Socket.connect (net.js:940:5)
npm verb stack at Object.connect (_tls_wrap.js:1148:12)
npm verb stack at HttpsAgent.createConnection (https.js:120:22)
npm verb stack at HttpsAgent.createSocket (/root/.nvm/versions/node/v10.14.1/lib/node_modules/npm/node_modules/agentkeepalive/lib/_http_agent.js:265:26)
npm verb stack at HttpsAgent.createSocket (/root/.nvm/versions/node/v10.14.1/lib/node_modules/npm/node_modules/agentkeepalive/lib/agent.js:77:11)
npm verb stack at HttpsAgent.addRequest (/root/.nvm/versions/node/v10.14.1/lib/node_modules/npm/node_modules/agentkeepalive/lib/_http_agent.js:239:10)
npm verb stack at new ClientRequest (_http_client.js:248:16)
npm verb stack at request (https.js:281:10)
npm verb stack at fetch.Promise (/root/.nvm/versions/node/v10.14.1/lib/node_modules/npm/node_modules/node-fetch-npm/src/index.js:54:17)
npm verb stack at new Promise ()
npm verb stack at fetch (/root/.nvm/versions/node/v10.14.1/lib/node_modules/npm/node_modules/node-fetch-npm/src/index.js:41:10)
npm verb stack at retry (/root/.nvm/versions/node/v10.14.1/lib/node_modules/npm/node_modules/make-fetch-happen/index.js:332:14)
npm verb Linux 3.10.0-957.el7.x86_64
npm verb argv "/root/.nvm/versions/node/v10.14.1/bin/node" "/root/.nvm/versions/node/v10.14.1/bin/npm" "install" "--verbose"
npm verb node v10.14.1
npm verb npm v6.4.1
npm ERR! code ERR_INVALID_OPT_VALUE
npm ERR! The value "4294967295" is invalid for option "family"
npm verb exit [ 1, true ]
npm timing npm Completed in 12911ms

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-04-24T06_52_05_646Z-debug.log`

@baslr
Copy link
Contributor

baslr commented Jun 10, 2019

@fr6nco @lsyeyexpo
is the environment a virtual one and the hypervisor is qemu with tcg?

The result of my investigation is:
In tcg environments -cpu qemu64 and no -enable-kvm

$ node
> a = undefined 
undefined
> a >>> 0
4294967295

on the host:

$ node
> a = undefined
undefined
> a >>> 0
0

so its ether a bug in

  • tcg code
  • compile bug in qemu
  • v8 code
  • compile bug in v8
  • compiler code
  • compile bug in compiler

@baslr
Copy link
Contributor

baslr commented Jun 10, 2019

same with
node on native hardware

node
Welcome to Node.js v12.4.0.
Type ".help" for more information.
> let buffer
undefined
> buffer |= 0
0

vm with tcg:

$ ./out/Release/node --version
v12.4.0
./out/Release/node -e "let buffer; buffer |= 0; console.log(buffer);"
-1

@vbashkirtsev
Copy link

It is the bug in TCG code. Here the patch which fixes it: https://git.qemu.org/?p=qemu.git;a=commitdiff_plain;h=1e8a98b53867f61da9ca09f411288e2085d323c4 . It is going to be in QEMU 4.2.0 but you can patch current QEMU yourself.

Here's the comment to that patch by Peter Maydell:

target/i386: Return 'indefinite integer value' for invalid SSE fp->int conversions

The x86 architecture requires that all conversions from floating
point to integer which raise the 'invalid' exception (infinities of
both signs, NaN, and all values which don't fit in the destination
integer) return what the x86 spec calls the "indefinite integer
value", which is 0x8000_0000 for 32-bits or 0x8000_0000_0000_0000 for
64-bits. The softfloat functions return the more usual behaviour of
positive overflows returning the maximum value that fits in the
destination integer format and negative overflows returning the
minimum value that fits.

Wrap the softfloat functions in x86-specific versions which
detect the 'invalid' condition and return the indefinite integer.

Note that we don't use these wrappers for the 3DNow! pf2id and pf2iw
instructions, which do return the minimum value that fits in
an int32 if the input float is a large negative number.

@Brucezhao1980
Copy link

keep one release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
npm Issues and PRs related to the npm client dependency or the npm registry.
Projects
None yet
Development

No branches or pull requests

10 participants