Cannot read property 'matches' of undefined When installing Jest in Angular

555 Views Asked by At

I want to use jset in my angular project. when I run the following command:

npm install jest --save-dev

Get the following error :

npm ERR! Cannot read property 'matches' of undefined

NOTE: before install jest I remove completely Karam with the following command :

npm remove karma karma-chrome-launcher karma-coverage-istanbul-reporter karma-jasmine karma-jasmine-html-reporter

How can I solve it?

Thanks in advance.

1

There are 1 best solutions below

0
Priyanka Raghunath On

it might help some one. I solved it by few workarounds by reinstalling below packages:

  1. removed node_modules and package-lock.json file
  2. npm install -g npm@latest
  3. when run npm install I got bug at node-gyp. i have to run npm i -g node-gyp

Now its working fine for me.