Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

npm ERR! Cannot read property 'match' of undefined #20954

Closed
1 of 14 tasks
doberkofler opened this issue Jun 11, 2018 · 10 comments
Closed
1 of 14 tasks

npm ERR! Cannot read property 'match' of undefined #20954

doberkofler opened this issue Jun 11, 2018 · 10 comments

Comments

@doberkofler
Copy link

doberkofler commented Jun 11, 2018

I'm opening this issue because:

  • npm is crashing.
  • npm is producing an incorrect install.
  • npm is doing something I don't understand.
  • npm is producing incorrect or undesirable behavior.
  • Other (see below for feature requests):

What's going wrong?

D:\MyDev\ljs_app\trunk\periscope\build>npm i
npm ERR! Cannot read property 'match' of undefined

2018-06-11T07_39_39_234Z-debug.log

When removing the package-lock.json file the installation works again.

How can the CLI team reproduce the problem?

Run npm i with the attached files

x.zip

configuration files:

supporting information:

  • npm -v prints: 6.1.0
  • node -v prints: 10.4.0
  • npm config get registry prints: http://registry.npmjs.org/
  • Windows, OS X/macOS, or Linux?: Windows
  • Network issues:
    • Geographic location where npm was run:
    • I use a proxy to connect to the npm registry.
    • I use a proxy to connect to the web.
    • I use a proxy when downloading Git repos.
    • I access the npm registry via a VPN
    • I don't use a proxy, but have limited or unreliable internet access.
  • Container:
    • I develop using Vagrant on Windows.
    • I develop using Vagrant on OS X or Linux.
    • I develop / deploy using Docker.
    • I deploy to a PaaS (Triton, Heroku).
@doberkofler
Copy link
Author

The error actually happens each time I use npm i now!

@legodude17
Copy link
Contributor

@doberkofler
Copy link
Author

@legodude17 I'm not sure I understand on what to do? I understand that by removing the lock file, I can use npm i once again. But then it is broken again.

@knownasilya
Copy link

knownasilya commented Jun 11, 2018

Yeah also seeing this issue. Deleting the lock file every time is not a solution for sure 😸

Here's my stack trace:

verbose stack TypeError: Cannot read property 'match' of undefined
18 verbose stack     at tarballToVersion (/usr/local/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:87:20)
18 verbose stack     at inflatableChild (/usr/local/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:99:22)
18 verbose stack     at BB.each (/usr/local/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:55:12)
18 verbose stack     at tryCatcher (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
18 verbose stack     at Object.gotValue (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/reduce.js:155:18)
18 verbose stack     at Object.gotAccum (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/reduce.js:144:25)
18 verbose stack     at Object.tryCatcher (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
18 verbose stack     at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
18 verbose stack     at Promise._settlePromise (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
18 verbose stack     at Promise._settlePromise0 (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
18 verbose stack     at Promise._settlePromises (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
18 verbose stack     at Async._drainQueue (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:133:16)
18 verbose stack     at Async._drainQueues (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:143:10)
18 verbose stack     at Immediate.Async.drainQueues (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
18 verbose stack     at runCallback (timers.js:789:20)
18 verbose stack     at tryOnImmediate (timers.js:751:5)

Using v6.1.0

@iarna
Copy link
Contributor

iarna commented Jun 13, 2018

Deleting the lock-file is not what the instruction in the community link was. The instruction is:

Delete the lock-file AND the node_modules:

npx rimraf package-lock.json npm-shrinkwrap.json node_modules

Can you all retry with that?

@knownasilya
Copy link

I tried both, the lockfile only and lockfile with node_modules. Both worked for me.

@doberkofler
Copy link
Author

@iarna Removing the lock file AND the node_modules folder worked for me. Only removing the lock file only worked once.

@homerjam
Copy link

homerjam commented Jun 20, 2018

I'm not sure why this issue is closed - it doesn't seem as though a true solution was found, only a workaround. Isn't the desirable behaviour to have npm handle this on it own?

Can anyone help with a workaround for global modules? Installed via homebrew and can't locate my package-lock.json anywhere!

Edit: use yarn

@chemzqm
Copy link

chemzqm commented Jun 25, 2018

19 verbose stack TypeError: Cannot read property 'match' of undefined
19 verbose stack     at tarballToVersion (/usr/local/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:87:20)
19 verbose stack     at inflatableChild (/usr/local/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:99:22)
19 verbose stack     at BB.each (/usr/local/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:55:12)
19 verbose stack From previous event:
19 verbose stack     at inflateShrinkwrap (/usr/local/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:51:13)
19 verbose stack     at inflatableChild.then (/usr/local/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:59:14)
19 verbose stack From previous event:
19 verbose stack     at BB.each (/usr/local/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:57:7)
19 verbose stack     at runCallback (timers.js:696:18)
19 verbose stack     at tryOnImmediate (timers.js:667:5)
19 verbose stack     at processImmediate (timers.js:649:5)
19 verbose stack From previous event:
19 verbose stack     at inflateShrinkwrap (/usr/local/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:51:13)
19 verbose stack     at module.exports (/usr/local/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:35:10)
19 verbose stack     at /usr/local/lib/node_modules/npm/lib/install/read-shrinkwrap.js:47:14
19 verbose stack     at a (/usr/local/lib/node_modules/npm/node_modules/iferr/iferr.js:3:64)
19 verbose stack     at BB.join.then (/usr/local/lib/node_modules/npm/lib/install/read-shrinkwrap.js:34:16)
19 verbose stack From previous event:
19 verbose stack     at readShrinkwrap (/usr/local/lib/node_modules/npm/lib/install/read-shrinkwrap.js:34:5)
19 verbose stack     at Function.module.exports.andInflate (/usr/local/lib/node_modules/npm/lib/install/read-shrinkwrap.js:45:3)
19 verbose stack     at Installer.loadShrinkwrap (/usr/local/lib/node_modules/npm/lib/install.js:714:18)
19 verbose stack     at Array.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/slide/lib/bind-actor.js:15:8)
19 verbose stack     at LOOP (/usr/local/lib/node_modules/npm/node_modules/slide/lib/chain.js:15:14)
19 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/slide/lib/chain.js:18:7
19 verbose stack     at /usr/local/lib/node_modules/npm/lib/install.js:372:5
19 verbose stack     at Array.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/slide/lib/bind-actor.js:15:8)
19 verbose stack     at LOOP (/usr/local/lib/node_modules/npm/node_modules/slide/lib/chain.js:15:14)
19 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/slide/lib/chain.js:18:7
19 verbose stack     at Installer.finishTracker (/usr/local/lib/node_modules/npm/lib/install.js:379:3)
19 verbose stack     at Array.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/slide/lib/bind-actor.js:15:8)
19 verbose stack     at LOOP (/usr/local/lib/node_modules/npm/node_modules/slide/lib/chain.js:15:14)
19 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/slide/lib/chain.js:18:7
19 verbose stack     at Installer.cloneCurrentTreeToIdealTree (/usr/local/lib/node_modules/npm/lib/install.js:708:3)
19 verbose stack     at Array.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/slide/lib/bind-actor.js:15:8)
19 verbose stack     at LOOP (/usr/local/lib/node_modules/npm/node_modules/slide/lib/chain.js:15:14)
19 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/slide/lib/chain.js:18:7
19 verbose stack     at /usr/local/lib/node_modules/npm/lib/install.js:372:5

Get this error from time to time, should I switch to yarn?

@akougblenou
Copy link

Still happening to me, it seemed that it was related to babel and the beta packages...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants