npm install or uninstall error

I keep getting npm ERR! tb.match is not a function whille doing npm install or npm uninstall command. I’m stuck. Please help. Here is a copy of the error log.

0 info it worked if it ends with ok
1 verbose cli [ '/Users/arturowibawa/.nvm/versions/node/v10.16.3/bin/node',
1 verbose cli   '/Users/arturowibawa/.nvm/versions/node/v10.16.3/bin/npm',
1 verbose cli   'uninstall',
1 verbose cli   'react-transition-group' ]
2 info using npm@6.9.0
3 info using node@v10.16.3
4 verbose npm-session d49cc24f4a0c360b
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 timing stage:loadCurrentTree Completed in 1934ms
8 silly install loadIdealTree
9 silly install cloneCurrentTreeToIdealTree
10 timing stage:loadIdealTree:cloneCurrentTree Completed in 17ms
11 silly install loadShrinkwrap
12 timing stage:rollbackFailedOptional Completed in 0ms
13 timing stage:runTopLevelLifecycles Completed in 2170ms
14 silly saveTree arturowibawa-v2@0.1.0
15 verbose stack TypeError: tb.match is not a function
15 verbose stack     at tarballToVersion (/Users/arturowibawa/.nvm/versions/node/v10.16.3/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:87:20)
15 verbose stack     at Object.keys.map._ (/Users/arturowibawa/.nvm/versions/node/v10.16.3/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:104:73)
15 verbose stack     at Array.map (<anonymous>)
15 verbose stack     at inflatableChild (/Users/arturowibawa/.nvm/versions/node/v10.16.3/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:104:45)
15 verbose stack     at BB.each (/Users/arturowibawa/.nvm/versions/node/v10.16.3/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:55:12)
15 verbose stack     at tryCatcher (/Users/arturowibawa/.nvm/versions/node/v10.16.3/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
15 verbose stack     at Object.gotValue (/Users/arturowibawa/.nvm/versions/node/v10.16.3/lib/node_modules/npm/node_modules/bluebird/js/release/reduce.js:155:18)
15 verbose stack     at Object.gotAccum (/Users/arturowibawa/.nvm/versions/node/v10.16.3/lib/node_modules/npm/node_modules/bluebird/js/release/reduce.js:144:25)
15 verbose stack     at Object.tryCatcher (/Users/arturowibawa/.nvm/versions/node/v10.16.3/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
15 verbose stack     at Promise._settlePromiseFromHandler (/Users/arturowibawa/.nvm/versions/node/v10.16.3/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
15 verbose stack     at Promise._settlePromise (/Users/arturowibawa/.nvm/versions/node/v10.16.3/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
15 verbose stack     at Promise._settlePromise0 (/Users/arturowibawa/.nvm/versions/node/v10.16.3/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
15 verbose stack     at Promise._settlePromises (/Users/arturowibawa/.nvm/versions/node/v10.16.3/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:694:18)
15 verbose stack     at _drainQueueStep (/Users/arturowibawa/.nvm/versions/node/v10.16.3/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:138:12)
15 verbose stack     at _drainQueue (/Users/arturowibawa/.nvm/versions/node/v10.16.3/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:131:9)
15 verbose stack     at Async._drainQueues (/Users/arturowibawa/.nvm/versions/node/v10.16.3/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:147:5)
16 verbose cwd /Users/arturowibawa/Sites/arturowibawa-v2
17 verbose Darwin 18.7.0
18 verbose argv "/Users/arturowibawa/.nvm/versions/node/v10.16.3/bin/node" "/Users/arturowibawa/.nvm/versions/node/v10.16.3/bin/npm" "uninstall" "react-transition-group"
19 verbose node v10.16.3
20 verbose npm  v6.9.0
21 error tb.match is not a function
22 verbose exit [ 1, true ]

Just in this project, or across multiple projects? I do not recognise the error, but if across multiple projects I suggest try reinstalling npm, just in case!

Looks like it’s only in this project. I tested on my other projects and the commands work just fine. I did try a clean reinstall of node and npm a few times but the problem still persists. What else should I do?

Try deleting both the package-lock.json file and the node_modules folder, and then running install again.

Suggestion from this post:

Yes! that did it, works again. Thank you for your help.

1 Like

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