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

prisma2 generate generates files into wrong directory #306

Closed
joeyaurel opened this issue Aug 1, 2019 · 3 comments
Closed

prisma2 generate generates files into wrong directory #306

joeyaurel opened this issue Aug 1, 2019 · 3 comments
Assignees
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug.
Milestone

Comments

@joeyaurel
Copy link

joeyaurel commented Aug 1, 2019

I am working with the Prisma2 Tutorial but am getting stuck where someone has to perform a prisma2 generate. (https://github.com/prisma/prisma2/blob/master/docs/tutorial.md#6-generate-photon-js)

It gets generated into the prisma/node_modules/ directory but should get generated into the root node_modules/ directory. My working directory is Prisma2 which contains the root node_modules/ directory.

Prisma version: 2.0.0-preview-3.2

Screenshot 2019-08-01 at 15 37 48

@joeyaurel
Copy link
Author

joeyaurel commented Aug 1, 2019

Update: After removing both node_modules/ directories and running npm install again it works.

Don't know what that was. Will open the issue again when it happens again.

Screenshot 2019-08-01 at 15 57 05

@darioielardi
Copy link

darioielardi commented Aug 2, 2019

I'm having the same problem, when I get to that tutorial step and I run prisma2 generate it generates the client in a node_modules folder inside the prisma folder, which is the only folder in the project.

So I tried to run npm init to get the node_modules folder in the project root, delete the generated folder ( the whole new prisma/node_modules ) and then run again prisma2 generate, which now managed to generates the client in the node_modules root folder of the project.

@joeyaurel joeyaurel reopened this Aug 2, 2019
@timsuchanek timsuchanek self-assigned this Aug 5, 2019
@pantharshit00
Copy link
Contributor

pantharshit00 commented Aug 5, 2019

I can now confirm this.

This only happens when there is no node_modules folder in the root at first. So you can run into this if you are using the postgres flow.

Steps to reproduce:

  1. Initialize a project using postgres flow
  2. Add a sample model and the photon generator to the schema.
  3. Run prisma2 generate.

@pantharshit00 pantharshit00 added bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. labels Aug 5, 2019
@janpio janpio added this to the Preview 6 milestone Aug 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug.
Projects
None yet
Development

No branches or pull requests

5 participants