Skip to content

generate tells me to install wrong Prisma Client package #1537

@janpio

Description

@janpio

Problem 1:

λ npx prisma2@alpha generate
Error: In order to use the "prisma-client-js" generator, you need to install @prisma/client to your project:
npm install @prisma/client

This should be npm install @prisma/client@alpha or better a specific version. Right now this leads to this situation:

C:\Users\Jan\Documents\throwaway\1496                                                                                 
λ npx prisma2@alpha generate                                                                                          
⚠️ @prisma/[email protected] is not compatible with [email protected]. Their versions need to be equal.   
Generated Prisma Client to .\node_modules\@prisma\client                                                              
Done in 13.52s                                                                                                        

Problem 2:

But as the project is basically empty besides the schema

λ tree /F                                  
Folder PATH listing for volume Local Disk  
Volume serial number is 8EC2-149E          
C:.                                        
│   schema.prisma                          
│                                          
└───.vscode                                
        settings.json                      

running the npm install command will not even work properly:

C:\Users\Jan\Documents\throwaway\1496
λ npm install @prisma/client

> @prisma/[email protected] postinstall C:\Users\Jan\Documents\throwaway\1496\node_modules\@prisma\client
> node scripts/postinstall.js

undefined
Error: In order to use "@prisma/client", please install prisma2. You can install it with "npm add -D prisma2".
    at main (C:\Users\Jan\Documents\throwaway\1496\node_modules\@prisma\client\scripts\postinstall.js:27:9)
    at processTicksAndRejections (internal/process/task_queues.js:85:5)
npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\Jan\Documents\throwaway\1496\package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Jan\Documents\throwaway\1496\package.json'
npm WARN @prisma/[email protected] requires a peer of prisma2@* but none is installed. You must install peer dependencies yourself.
npm WARN 1496 No description
npm WARN 1496 No repository field.
npm WARN 1496 No README data
npm WARN 1496 No license field.

+ @prisma/[email protected]
added 1 package and audited 1 package in 6.03s
found 0 vulnerabilities

This does create node_modules and a package-lock.json, but no package.json - so the project is not in the correct state.


λ npx prisma2@alpha -v
[email protected], binary version: 08074c311c544a995f4ac86e0ea865ae1845b365

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions