`TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Object` when old `@prisma/client` in parent folder
See original GitHub issue- new folder
npm init -y
npm install prisma
npx prisma init
- adapt schema file:
datasource db {
provider = "sqlite"
url = "file:./dev.db"
}
generator client {
provider = "prisma-client-js"
}
model User {
id Int @id @default(autoincrement())
name String
}
npx prisma db push --preview-feature
db push
works, but then generation fails with:
C:\Users\Jan\Documents\throwaway\pathtypestring (pathtypestring@1.0.0)
λ npx prisma db push --preview-feature
Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
Datasource "db": SQLite database "dev.db" at "file:./dev.db"
SQLite database dev.db created at file:./dev.db
Your database is now in sync with your schema. Done in 57ms
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Object
at new NodeError (node:internal/errors:329:5)
at validateString (node:internal/validators:129:11)
at Object.join (node:path:397:7)
at getDotPrismaDir (C:\Users\Jan\Documents\throwaway\node_modules\@prisma\client\generator-build\index.js:72820:33)
at Object.generateClient (C:\Users\Jan\Documents\throwaway\node_modules\@prisma\client\generator-build\index.js:72842:49)
at Object.onGenerate (C:\Users\Jan\Documents\throwaway\node_modules\@prisma\client\generator-build\index.js:78035:34)
at LineStream.<anonymous> (C:\Users\Jan\Documents\throwaway\node_modules\@prisma\client\generator-build\index.js:2802:40)
at LineStream.emit (node:events:369:20)
at addChunk (node:internal/streams/readable:313:12)
at readableAddChunk (node:internal/streams/readable:288:9)
C:\Users\Jan\Documents\throwaway\pathtypestring (pathtypestring@1.0.0)
λ cat package.json
{
"name": "pathtypestring",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"prisma": "^2.20.1"
}
}
C:\Users\Jan\Documents\throwaway\pathtypestring (pathtypestring@1.0.0)
λ npx prisma -v
Environment variables loaded from .env
prisma : 2.20.1
@prisma/client : 2.15.0-dev.73
Current platform : windows
Query Engine : query-engine 60ba6551f29b17d7d6ce479e5733c70d9c00860e (at node_modules\@prisma\engines\query-engine-windows.exe)
Migration Engine : migration-engine-cli 60ba6551f29b17d7d6ce479e5733c70d9c00860e (at node_modules\@prisma\engines\migration-engine-windows.exe)
Introspection Engine : introspection-core 60ba6551f29b17d7d6ce479e5733c70d9c00860e (at node_modules\@prisma\engines\introspection-engine-windows.exe)
Format Binary : prisma-fmt 60ba6551f29b17d7d6ce479e5733c70d9c00860e (at node_modules\@prisma\engines\prisma-fmt-windows.exe)
Default Engines Hash : 60ba6551f29b17d7d6ce479e5733c70d9c00860e
Studio : 0.365.0
⚠️ Note how this lists @prisma/client : 2.15.0-dev.73
.
Turns out there was a package.json
in a parent folder with this old @prisma/client version.
Expectation would be to at least get a warning about this incompatible version.
(I assume that using this dependency from the parent folder is “normal” in Node?)
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (6 by maintainers)
Top Results From Across the Web
typeerror [err_invalid_arg_type]: the "file" argument must be of ...
The error message means that a method of the path module (like path.join ) expects one of its arguments to be a string...
Read more >The "path" argument must be of type string ... - Stack Overflow
I'm working on a project in React and ran into a problem that has me stumped. Whenever I run yarn start I get...
Read more >How To Fix Sfdx Error: The "Path" Argument Must Be Of Type ...
TypeError [ERRINVALIDARGTYPE]: The path argument must be of type string. Received an instance of Object when old @prisma/client in parent folder #6372.
Read more >The "path" argument must be of type string. Received - YouTube
JavaScript : TypeError [ERR_INVALID_ARG_TYPE]: The " path " argument must be of type string. Received type undefined raised when starting ...
Read more >Is Prisma an ORM?
Traditional ORMs provide an object-oriented way for working with ... use Prisma Client to read and write data in your database in a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The solution is to update both CLI and Client to the same version.
updated
@prisma/client
to2.21.2
and the commandyarn prisma generate
didn’t throw any error 👍👍 thanks @janpio