Jest for React - "Cannot find module @testing-library/jest-dom from jest-setup.js"

Trying to do testing with jest and jest-dom, both of them are installed. However I get “Cannot find module @testing-library/jest-dom” when trying to do a simple test in App.test.js

I also have jest-setup.js where I import @testing-library/jest-dom

In my jest.config.js I have specified setupFilesAfterEnv.

What am I missing here?