question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'tarball' of undefined after 'npm install @fortawesome/fontawesome-svg-core'

See original GitHub issue

Describe the bug When doing a npm install @fortawesome/fontawesome-svg-core, verdaccio throws an UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'tarball' of undefined at convertDistRemoteToLocalTarballUrls (/opt/verdaccio/build/lib/utils.js:209:89).

To Reproduce

Steps to reproduce the behavior:

  1. run latest verdaccio/verdaccio docker image
  2. set local npm to use verdaccio
  3. npm install @fortawesome/fontawesome-svg-core
  4. verdaccio throws and crashes
  5. local npm times out with error

Expected behavior

verdaccio should be able to proxy/cache the @fortawesome/fontawesome-svg-core package without crashing.

Docker || Kubernetes (please complete the following information):

  • Docker verdaccio tag: latest

Configuration File (cat ~/.config/verdaccio/config.yaml)

storage: /verdaccio/storage/packages
plugins: /verdaccio/plugins

auth:
  htpasswd:
    file: /verdaccio/storage/htpasswd

security:
  api:
    jwt:
      sign:
        expiresIn: 60d
        notBefore: 1
  web:
    sign:
      expiresIn: 7d
      notBefore: 1

uplinks:
  npmjs:
    url: https://registry.npmjs.org/

packages:
  '@*/*':
    access: $all
    proxy: npmjs
    storage: cached

  '**':
    access: $all
    proxy: npmjs
    storage: cached

middlewares:
  audit:
    enabled: true

logs:
  - { type: stdout, format: pretty, level: http }

Environment information

Environment Info:

  System:
    OS: Linux 4.4 Alpine Linux undefined
    CPU: (4) x64 Intel(R) Core(TM) i3-4130 CPU @ 3.40GHz
  Binaries:
    Node: 10.16.3 - /usr/local/bin/node
    Yarn: 1.17.3 - /usr/local/bin/yarn
    npm: 6.9.0 - /usr/local/bin/npm

Debugging output

2019-12-12T10:47:45.796372+01:00 | npm-registry_app_1 |  http <-- 200, user: XXX(XXX via XXXX), req: 'GET /@fortawesome%2ffontawesome-svg-core', bytes: 0/0
2019-12-12T10:48:36.147890+01:00 | npm-registry_app_1 | (node:7) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'tarball' of undefined
2019-12-12T10:48:36.147913+01:00 | npm-registry_app_1 |     at convertDistRemoteToLocalTarballUrls (/opt/verdaccio/build/lib/utils.js:209:89)
2019-12-12T10:48:36.147920+01:00 | npm-registry_app_1 |     at Object.getPackageMetaCallback [as callback] (/opt/verdaccio/build/api/endpoint/api/package.js:39:65)
2019-12-12T10:48:36.147924+01:00 | npm-registry_app_1 |     at getPackageSynUpLinksCallback (/opt/verdaccio/build/lib/storage.js:336:17)
2019-12-12T10:48:36.147927+01:00 | npm-registry_app_1 |     at self.localStorage.updateVersions (/opt/verdaccio/build/lib/storage.js:603:9)
2019-12-12T10:48:36.147930+01:00 | npm-registry_app_1 |     at _readCreatePackage (/opt/verdaccio/build/lib/local-storage.js:210:9)
2019-12-12T10:48:36.147935+01:00 | npm-registry_app_1 |     at storage.readPackage (/opt/verdaccio/build/lib/local-storage.js:712:7)
2019-12-12T10:48:36.147939+01:00 | npm-registry_app_1 |     at _readStorageFile.then.res (/opt/verdaccio/node_modules/@verdaccio/local-storage/lib/local-fs.js:199:9)
2019-12-12T10:48:36.148398+01:00 | npm-registry_app_1 | (node:7) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 5)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
casdevscommented, Dec 20, 2019

manually removing the downloaded package from the verdaccio cache folder and re-downloading it helped for the moment, however, I think the checks / error handling mentioned above should be improved anyway so verdaccio doesn’t crash even if a package returns unexpected metadata. Maybe the metadata even got corrupted by verdaccio itself internally somehow… Currently, I cannot reproduce the error but will report back if it occurs again.

0reactions
juanpicadocommented, Apr 10, 2020

I’m closing this, too old, please if the error persist don’t hesitate to comment and provide more information 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Cannot read property 'match' of undefined" during Npm install
The problem that i call the nodejs VERSIONS HELL! (NOTE: after reflection! For npm it may not be a version HELL! READ TO...
Read more >
Cannot read property 'url' of undefined when starting server.js ...
So to properly install the correct dependencies, go to the folder that contains server.js, nodejs.config.js, package.json. run: npm install npm ...
Read more >
tar - npm
A "tar file" or "tarball" is an archive of file system entries (directories, files, links, etc.) The name comes from "tape archive". If...
Read more >
Cannot read property .match of undefined - Heroku Help
Running an npm command, such as npm install or npm ci , may raise something like this: npm err TypeError: Cannot read property...
Read more >
NPM - Cannot read property "match" of undefined
When trying to run an npm command, you can't install the packages, you may get the error: stephen... Tagged with npm, troubleshooting, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found