Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot find module 'graphql-request' #82

Open
josiahbryan opened this issue Aug 8, 2023 · 9 comments
Open

Error: Cannot find module 'graphql-request' #82

josiahbryan opened this issue Aug 8, 2023 · 9 comments

Comments

@josiahbryan
Copy link

Error on fresh install of "weaviate-ts-client": "^1.4.0", - it's unusable:

/Users/josiahbryan/devel/rubber/backend/node_modules/weaviate-ts-client/dist/index.js:1
Error: Cannot find module 'graphql-request'
Require stack:
- /Users/josiahbryan/devel/rubber/backend/node_modules/weaviate-ts-client/dist/index.js
- /Users/josiahbryan/devel/rubber/backend/src/services/chatbot/utils/graph/node-indexer.js
    at Object.<anonymous> (/Users/josiahbryan/devel/rubber/backend/node_modules/weaviate-ts-client/dist/index.js:1)
    at Generator.next (<anonymous>) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/josiahbryan/devel/rubber/backend/node_modules/weaviate-ts-client/dist/index.js',
    '/Users/josiahbryan/devel/rubber/backend/src/services/chatbot/utils/graph/node-indexer.js'
  ]
}

Node.js v20.5.0
@tsmith023
Copy link
Contributor

Hi @josiahbryan, thanks for raising this. I'll look into it and get back to you!

@tsmith023
Copy link
Contributor

tsmith023 commented Aug 8, 2023

@josiahbryan, I have setup and installed fresh versions of your Node version and the latest client on my Windows and Mac machines without issue! The current CI tests the package's functionality on ubuntu also.

If you are able, a more comprehensive MRE would be helpful to diagnose the problem you're facing.

@josiahbryan
Copy link
Author

Hmm, will attempt to reproduce again and isolate. Thanks for the quick response! WiIll get back to you in next ~3 hours or so

@josiahbryan
Copy link
Author

Looks like I needed to manually install deps graphql and graphql-request - is that expected that I have those installed in my project even though I don't use them, but this lib does?

@tsmith023
Copy link
Contributor

No, that's quite unexpected since such dependencies should be private and are not peer dependencies! I only ran npm install weaviate-ts-client in my empty package.json file without issues 🤔

My guess is that you may have some machine-specific global configuration of npm specified in your .npmrc file that is affecting the installation process. If this is not the case, then we can troubleshoot otherwise if you replicate the installation process with verbose logging:

  1. Create a fresh package.json file by running npm init in an empty directory
  2. Run npm install --verbose weaviate-ts-client
  3. Inspect the terminal logs for any installation errors, pasting the log output here

@zoranbabic
Copy link

I ran into a similar issue. We are using pnpm in our project, which doesn't install peer dependencies automatically.
The weaviate SDK package has a dependency to graphql-request which has a peer dependency to graphql. After installing weaviate-ts-client I received this warning:

WARN  Issues with peer dependencies found
packages/search
└─┬ weaviate-ts-client 1.5.0
  └─┬ graphql-request 5.2.0
    ├── ✕ missing peer graphql@"14 - 16"
    └─┬ @graphql-typed-document-node/core 3.2.0
      └── ✕ missing peer graphql@"^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
Peer dependencies that should be installed:
  graphql@">=14.0.0 <15.0.0 || >=15.0.0 <16.0.0 || >=16.0.0 <17.0.0"  

The SDK of course wouldn't work and complain: Error: Cannot find module 'graphql' - until I installed graphql manually.

@malgamves
Copy link

I use yarn and had the same issue, installing graphql fixed it

The SDK of course wouldn't work and complain: Error: Cannot find module 'graphql' - until I installed graphql manually.

@geminigeek
Copy link

same issue version 2.0.0

@j-d-carmichael
Copy link

Not quite the same but in the same area: #106

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants