DEV Community

Sewvandi Promodya Wickramasinghe
Sewvandi Promodya Wickramasinghe

Posted on

npm ERR! Cannot read property 'match' of undefined

Some time back, I downloaded a react-tutorial-project from GitHub and tried to install the dependencies with the command npm install. It threw the following error and I couldn't install the packages.

PS C:\Users\Sewwandi\Desktop\reactjs-tutorial-master> npm install
npm ERR! Cannot read property 'match' of undefined

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Sewwandi\AppData\Roaming\npm-cache\_logs\2020-04-19T15_32_14_320Z-debug.log
PS C:\Users\Sewwandi\Desktop\reactjs-tutorial-master> 
Enter fullscreen mode Exit fullscreen mode

If you had the same error code, there is a quick workaround. Follow the following steps.

First step
Delete node_modules and lock-file. (package-lock.json, yarn.lock)

Second step
Run npm install again.

If there are any issues, feel free to share them in the comments section :)

Top comments (2)

Collapse
 
arinzehills profile image
ARINZE CHRIS HILLS

I have tried mine it still did not work

Collapse
 
sewvandiii profile image
Sewvandi Promodya Wickramasinghe

Try deleting all the lock files including package-lock.json and yarn.lock