loading...

npm ERR! Cannot read property 'match' of undefined

sewvandiii profile image Sewvandi Promodya Wickramasinghe ・1 min read

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> 

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 :)

Discussion

markdown guide