'prisma client not see schema in globally installed node_modules
I currently develop a nodejs cli with prisma and planning to ship sqlite3 db with @prisma/client.
npm creates symnlink between bin file and the package downloaded under the folder node_modules. When I run globally installed package from any location, @prisma/client complained about mongo url (sqlite db source is in schema.) which means not see my schema under the node_modules.
Any idea of how to ship prisma client with node cli program?
Here is my schema
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "sqlite"
url = "file:database.db"
}
...
...
here is the bin location of my package /opt/homebrew/bin/my-package
here is where package is loaded with its schema and its node_modules /opt/homebrew/lib/node_modules/my-package
Here is the error message provided by prisma/client
error: Error validating datasource `db`: the URL must start with the protocol `mongo`.
--> schema.prisma:11
|
10 | provider = "mongodb"
11 | url = env("DATABASE_URL")
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
