npm ERR! Cannot read property ‘match’ of undefined error handling

Time:2021-9-23

Before NPM install suddenly reports this error, it is still good

npm ERR! Cannot read property 'match' of undefined
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user\AppData\Roaming\npm-cache\_logs18-08-06T01_49_46_486Z-debug.log

Recall that there should be more package-lock.json in the project

Follow the steps below:

  1. npm cache clear --force(after execution, NPM install is ineffective, and then proceed to step 2)
  2. Delete package-lock.json under the project folder, and then run NPM install (step 3 is ineffective)
  3. rm -rf node_modules
    rm package-lock.json
    npm cache clear --force
    npm install

Value reference:

An accident caused by package lock

Recommended Today

Seven Python code review tools recommended

althoughPythonLanguage is one of the most flexible development languages at present, but developers often abuse its flexibility and even violate relevant standards. So PythoncodeThe following common quality problems often occur: Some unused modules have been imported Function is missing arguments in various calls The appropriate format indentation is missing Missing appropriate spaces before and after […]