Graphql-yoga: Error: Cannot find module 'graphql-yoga'

Created on 28 Apr 2018  路  2Comments  路  Source: dotansimha/graphql-yoga

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.

Most helpful comment

This is discussed in #297 . For now, changing to [email protected] helps (or waiting for a fixed release).

All 2 comments

This is discussed in #297 . For now, changing to [email protected] helps (or waiting for a fixed release).

This is fixed now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

woss picture woss  路  5Comments

2wce picture 2wce  路  4Comments

frederikhors picture frederikhors  路  4Comments

chakrihacker picture chakrihacker  路  5Comments

CaptainChemist picture CaptainChemist  路  4Comments