I was working with graphql-yoga today on a new project and the installed npm will not work. I see the following error:
Error: Cannot find module 'graphql-yoga'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:571:15)
at Function.Module._load (internal/modules/cjs/loader.js:497:25)
at Module.require (internal/modules/cjs/loader.js:626:17)
at require (internal/modules/cjs/helpers.js:20:18)
I took a look at the npm folder and noticed a broken link in the pacakge.json. The "main": "dist/src/index.js" file is not in that location. It's just in the dist folder. I do not see a src folder. When I change the value to: "main": "dist/index.js"... it works!
I don't know if a recent changed caused this, but I was unable to get any server running until I applied this fix.
This is discussed in #297 . For now, changing to [email protected] helps (or waiting for a fixed release).
This is fixed now.
Most helpful comment
This is discussed in #297 . For now, changing to
[email protected]helps (or waiting for a fixed release).