Running an npm command, such as
npm install or
npm ci, may raise something like this:
npm err TypeError: Cannot read property 'match' of undefined
and break the script that is running.
This is a known version bug in NPM. Right now, the best way to resolve is to regenerate the
package-lock.json until there is a fix for the cause.
npm-shrinkwrap.json, if that is what is being used). (
rm package-lock.json && rm -rf node_modules)
Check the local versions of Node and npm.
node -v npm -v
If the Node and npm versions locally don't match the
package.json, install the versions that match the
package.json. For information on installing Node and npm locally, visit the Node docs: https://nodejs.org/en/download/
package-lock.json. Do this by running
npm install. The
node_moduleswill also be regenerated.