npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

cannot read match of undefined

I got his npm error:

$ npm i
npm ERR! Cannot read property 'match' of undefined

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/Olegzandr/.npm/_logs/2018-12-23T08_25_02_584Z-debug.log

I also got the same error when running npm link -f

here is the log:

0 info it worked if it ends with ok
1 verbose cli [ '/Users/Olegzandr/.nvm/versions/node/v11.4.0/bin/node',
1 verbose cli   '/Users/Olegzandr/.nvm/versions/node/v11.4.0/bin/npm',
1 verbose cli   'i' ]
2 info using npm@6.5.0
3 info using node@v11.4.0
4 verbose npm-session 9325ff27fa70df7f
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall r2g@0.1.196
7 info lifecycle r2g@0.1.196~preinstall: r2g@0.1.196
8 silly install loadCurrentTree
9 silly install readLocalPackageData
10 timing stage:loadCurrentTree Completed in 68ms
11 silly install loadIdealTree
12 silly install cloneCurrentTreeToIdealTree
13 timing stage:loadIdealTree:cloneCurrentTree Completed in 0ms
14 silly install loadShrinkwrap
15 timing stage:rollbackFailedOptional Completed in 0ms
16 timing stage:runTopLevelLifecycles Completed in 109ms
17 silly saveTree r2g@0.1.196
18 verbose stack TypeError: Cannot read property 'match' of undefined
18 verbose stack     at tarballToVersion (/Users/Olegzandr/.nvm/versions/node/v11.4.0/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:87:20)
18 verbose stack     at inflatableChild (/Users/Olegzandr/.nvm/versions/node/v11.4.0/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:99:22)
18 verbose stack     at BB.each (/Users/Olegzandr/.nvm/versions/node/v11.4.0/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:55:12)
18 verbose stack     at tryCatcher (/Users/Olegzandr/.nvm/versions/node/v11.4.0/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
18 verbose stack     at Object.gotValue (/Users/Olegzandr/.nvm/versions/node/v11.4.0/lib/node_modules/npm/node_modules/bluebird/js/release/reduce.js:155:18)
18 verbose stack     at Object.gotAccum (/Users/Olegzandr/.nvm/versions/node/v11.4.0/lib/node_modules/npm/node_modules/bluebird/js/release/reduce.js:144:25)
18 verbose stack     at Object.tryCatcher (/Users/Olegzandr/.nvm/versions/node/v11.4.0/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
18 verbose stack     at Promise._settlePromiseFromHandler (/Users/Olegzandr/.nvm/versions/node/v11.4.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
18 verbose stack     at Promise._settlePromise (/Users/Olegzandr/.nvm/versions/node/v11.4.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
18 verbose stack     at Promise._settlePromise0 (/Users/Olegzandr/.nvm/versions/node/v11.4.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
18 verbose stack     at Promise._settlePromises (/Users/Olegzandr/.nvm/versions/node/v11.4.0/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:694:18)
18 verbose stack     at _drainQueueStep (/Users/Olegzandr/.nvm/versions/node/v11.4.0/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:138:12)
18 verbose stack     at _drainQueue (/Users/Olegzandr/.nvm/versions/node/v11.4.0/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:131:9)
18 verbose stack     at Async._drainQueues (/Users/Olegzandr/.nvm/versions/node/v11.4.0/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:147:5)
18 verbose stack     at Immediate.Async.drainQueues [as _onImmediate] (/Users/Olegzandr/.nvm/versions/node/v11.4.0/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
18 verbose stack     at processImmediate (timers.js:632:19)
19 verbose cwd /Users/Olegzandr/WebstormProjects/oresoftware/r2g
20 verbose Darwin 15.6.0
21 verbose argv "/Users/Olegzandr/.nvm/versions/node/v11.4.0/bin/node" "/Users/Olegzandr/.nvm/versions/node/v11.4.0/bin/npm" "i"
22 verbose node v11.4.0
23 verbose npm  v6.5.0
24 error Cannot read property 'match' of undefined
25 verbose exit [ 1, true ]


Do you have a set of dependencies or a repository with which to reproduce this issue? This looks like an invalid package-lock.json by the way, but it would be nice to know what caused it.