tanstack react-query ENOENT error when uninstalling v5 and installing v4

14 Views Asked by At

FULL ERROR:

./node_modules/@tanstack/react-query/build/modern/index.js Error: ENOENT: no such file or directory, open 'C:\Users\riodj\infoscan\node_modules@tanstack\react-query\build\modern\index.js'

CONTEXT: after installing and setting up trpc using

npm install @trpc/server@next @trpc/client@next @trpc/react-query@next @trpc/next@next @tanstack/react-query@latest zod

I had uninstalled @tanstack/react-query individually, as the installed version was v5 and I wanted to use react-query v4.

So I installed v4 with

npm install @tanstack/[email protected]

and then I get the aforementioned error message on my localhost:3000

ADDITIONALS:

This is my terminal after install v4 process terminal

WHAT I'VE TRIED:

changing @tanstack/react-query version in peerDependencies under node_modules/@trpc/next in the package-lock.json file (from ^5.25.0 to ^4.36.1)

0

There are 0 best solutions below