TypeError: Cannot read property 'match' of undefined

What I Wanted to Do

Install my npm dependencies.

What Happened Instead

npm ERR! Cannot read property 'match' of undefined

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/christianbundy/.npm/_logs/2019-04-16T19_02_47_233Z-debug.log

Reproduction Steps

Create a new directory with this package.json:

{
  "dependencies": {
    "app-root-path": "^2.2.1",
    "async": "^2.6.2",
    "bulk-require": "^1.0.1",
    "color-hash": "^1.0.3",
    "compare-version": "^0.1.2",
    "cross-script": "^1.0.5",
    "deep-equal": "^1.0.1",
    "depject": "^4.1.1",
    "depnest": "^1.3.0",
    "electron-default-menu": "~1.0.1",
    "electron-spellchecker": "github:ssbc/electron-spellchecker-prebuilt",
    "electron-window-state": "^5.0.3",
    "emoji-named-characters": "^1.0.2",
    "emojilib": "^2.4.0",
    "escape-string-regexp": "^1.0.5",
    "fix-path": "^2.1.0",
    "flat": "^4.1.0",
    "flatpickr": "4.5.2",
    "flumedb": "github:mmckegg/flumedb#add-await-ready-option",
    "flumeview-reduce": "^1.3.16",
    "hashlru": "^2.3.0",
    "hex-rgb": "^4.0.0",
    "highlight.js": "^9.15.6",
    "html-escape": "^2.0.0",
    "human-time": "0.0.2",
    "i18n": "^0.8.3",
    "lodash.concat": "^4.5.0",
    "lodash.filter": "^4.6.0",
    "micro-css": "^2.0.1",
    "moment-timezone": "^0.5.23",
    "mutant": "github:mmckegg/mutant#intersection-binding-viewport",
    "mutant-pull-reduce": "^1.1.0",
    "patch-settings": "^1.1.2",
    "pull-abortable": "^4.1.1",
    "pull-cat": "^1.1.11",
    "pull-cont": "^0.1.1",
    "pull-defer": "^0.2.3",
    "pull-flatmap": "0.0.1",
    "pull-next": "~1.0.1",
    "pull-paramap": "^1.2.2",
    "pull-pause": "~0.0.2",
    "pull-pushable": "^2.2.0",
    "pull-reconnect": "0.0.3",
    "pull-stream": "^3.6.9",
    "require-style": "^1.0.1",
    "run-parallel": "^1.1.9",
    "scuttle-blog": "^1.0.1",
    "scuttle-tag": "0.4.0",
    "sorted-array-functions": "^1.1.0",
    "spacetime": "^5.5.0",
    "ssb-about": "github:ssbc/ssb-about#use-await-ready",
    "ssb-backlinks": "^0.7.3",
    "ssb-blob-files": "github:ssbc/ssb-blob-files#localizable-errors-and-early-return",
    "ssb-blobs": "^1.1.13",
    "ssb-client": "^4.7.1",
    "ssb-config": "^3.2.5",
    "ssb-ebt": "^5.4.3",
    "ssb-feed": "^2.3.0",
    "ssb-gossip": "^1.0.9",
    "ssb-invite": "^2.0.4",
    "ssb-keys": "^7.1.5",
    "ssb-markdown": "^4.1.0",
    "ssb-mentions": "^0.5.0",
    "ssb-msgs": "^5.2.0",
    "ssb-private": "^0.2.3",
    "ssb-query": "^2.3.0",
    "ssb-ref": "^2.13.9",
    "ssb-replicate": "^1.2.1",
    "ssb-search": "^1.1.2",
    "ssb-server": "^14.1.9",
    "ssb-sort": "^1.1.0",
    "ssb-tags": "^0.2.0",
    "ssb-uri": "^1.0.1",
    "ssb-ws": "^6.0.0",
    "standard": "^12.0.1",
    "suggest-box": "github:mmckegg/suggest-box#scroll-selection-into-view",
    "text-node-searcher": "^1.1.1",
    "xtend": "^4.0.1"
  },
  "devDependencies": {
    "colors": "^1.3.3",
    "electron": "^2.0.18",
    "electron-builder": "^20.39.0"
  },
  "optionalDependencies": {
    "mouse-forward-back": "^1.0.1"
  }
}

Run npm install with either npm 6.9.0 (@latest) or 6.9.1 (@next).

Details

2536 verbose stack TypeError: Cannot read property 'match' of undefined
2536 verbose stack     at tarballToVersion (/home/christianbundy/.node_modules/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:87:20)
2536 verbose stack     at inflatableChild (/home/christianbundy/.node_modules/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:99:22)
2536 verbose stack     at BB.each (/home/christianbundy/.node_modules/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:55:12)
2536 verbose stack     at tryCatcher (/home/christianbundy/.node_modules/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
2536 verbose stack     at Object.gotValue (/home/christianbundy/.node_modules/lib/node_modules/npm/node_modules/bluebird/js/release/reduce.js:155:18)
2536 verbose stack     at Object.gotAccum (/home/christianbundy/.node_modules/lib/node_modules/npm/node_modules/bluebird/js/release/reduce.js:144:25)
2536 verbose stack     at Object.tryCatcher (/home/christianbundy/.node_modules/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
2536 verbose stack     at Promise._settlePromiseFromHandler (/home/christianbundy/.node_modules/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
2536 verbose stack     at Promise._settlePromise (/home/christianbundy/.node_modules/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
2536 verbose stack     at Promise._settlePromise0 (/home/christianbundy/.node_modules/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
2536 verbose stack     at Promise._settlePromises (/home/christianbundy/.node_modules/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:694:18)
2536 verbose stack     at _drainQueueStep (/home/christianbundy/.node_modules/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:138:12)
2536 verbose stack     at _drainQueue (/home/christianbundy/.node_modules/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:131:9)
2536 verbose stack     at Async._drainQueues (/home/christianbundy/.node_modules/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:147:5)
2536 verbose stack     at Immediate.Async.drainQueues [as _onImmediate] (/home/christianbundy/.node_modules/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
2536 verbose stack     at runCallback (timers.js:705:18)
2537 verbose cwd /home/christianbundy/src/ssbc/test
2538 verbose Linux 5.0.7-arch1-1-ARCH
2539 verbose argv "/usr/bin/node" "/home/christianbundy/.node_modules/bin/npm" "i"
2540 verbose node v10.15.3
2541 verbose npm  v6.9.1-next.0
2542 error Cannot read property 'match' of undefined
2543 verbose exit [ 1, true ]

Platform Info

$ npm --versions
{ npm: '6.9.1-next.0',
  ares: '1.15.0',
  cldr: '35.0',
  http_parser: '2.9.0',
  icu: '64.1',
  modules: '64',
  napi: '3',
  nghttp2: '1.36.0',
  node: '10.15.3',
  openssl: '1.1.1b',
  tz: '2018i',
  unicode: '12.0',
  uv: '1.27.0',
  v8: '6.8.275.32-node.51',
  zlib: '1.2.11' }
$ node -p process.platform
linux
$ uname -a
Linux samus 5.0.7-arch1-1-ARCH #1 SMP PREEMPT Mon Apr 8 10:37:08 UTC 2019 x86_64 GNU/Linux

Nevermind, it looks like this was coming from an invalid npm-shrinkwrap.json: https://github.com/ssbc/ssb-server/issues/654

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.