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 on nexus generation #765

Closed
TomChv opened this issue Jul 25, 2020 · 3 comments
Closed

Error on nexus generation #765

TomChv opened this issue Jul 25, 2020 · 3 comments
Labels
type/docs Relates to knowledge transfer matter (refs, guides, tuts, examples, ...)

Comments

@TomChv
Copy link
Contributor

TomChv commented Jul 25, 2020

Hello !

My project is in typescript
I use the "nexus-plugin-prisma" plugin in version: "^0.16.1".

I have an error when I want to generate my nexus schema.
It tells me I have to generate my client Prisma first... The problem being that I generate it successfully beforehand.

Dependencies

  "dependencies": {
    "@nexus/schema": "^0.14.0",
    "@prisma/client": "^2.1.3",
    "@types/node": "^14.0.23",
    "apollo-server-express": "^2.15.1",
    "cors": "^2.8.5",
    "express": "^4.17.1",
    "http": "0.0.1-security",
    "nexus": "^0.25.0",
    "nexus-plugin-prisma": "^0.16.1",
    "ts-node": "^8.10.2",
    "ts-node-dev": "^1.0.0-pre.52",
    "typescript": "^3.9.6"
  },
  "devDependencies": {
    "@prisma/cli": "^2.1.3",
    "@types/multer": "^1.4.3",
    "body-parser": "^1.19.0",
    "multer": "^1.4.2"
  }

Error :

error-nexus-generation

Then I saw a warning from nexus-plugin-prisma telling me to uninstall the dependencies "@prisma/cli" and "@prisma/client". But the problem persists... He can't find prisma now.

"dependencies": {
    "@nexus/schema": "^0.14.0",
    "@types/node": "^14.0.23",
    "apollo-server-express": "^2.15.1",
    "cors": "^2.8.5",
    "express": "^4.17.1",
    "http": "0.0.1-security",
    "nexus": "^0.25.0",
    "nexus-plugin-prisma": "^0.16.0",
    "ts-node": "^8.10.2",
    "ts-node-dev": "^1.0.0-pre.52",
    "typescript": "^3.9.6"
  },
  "devDependencies": {
    "@types/multer": "^1.4.3",
    "body-parser": "^1.19.0",
    "multer": "^1.4.2"
  }

Error after uninstall @prisma/cli and @prisma/client :
error-prisma

@TomChv
Copy link
Contributor Author

TomChv commented Jul 25, 2020

I found a solution !

Basically, when I install nexus-plugin-prisma, it automatically installs @prisma/client and @prisma/cli and nexus puts you a warning that you have to do "npm remove @prisma/client and @prisma/cli" . The problem is that it also removes the plugins in nexus-plugin-prisma/@prisma/client .... So you have to reinstall nexus-plugin-prisma by hand.

@hatchli
Copy link

hatchli commented Aug 2, 2020

Thank you @TomChv !

jasonkuhrt added a commit that referenced this issue Aug 3, 2020
Relates to #765 

Co-authored-by: Jason Kuhrt <jasonkuhrt@me.com>
@jasonkuhrt
Copy link
Contributor

And thanks @TomChv for the PR as well. Very much appreciated. I tweaked to be:

rm -rf node_modules
npm install

As I think that should be enough. If you know otherwise please let me know 🙏

@jasonkuhrt jasonkuhrt added the type/docs Relates to knowledge transfer matter (refs, guides, tuts, examples, ...) label Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/docs Relates to knowledge transfer matter (refs, guides, tuts, examples, ...)
Projects
None yet
Development

No branches or pull requests

3 participants