Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

flutter platform ERROR"spawn dart run orm ENOENT" #416

Closed
lsxqer opened this issue Aug 25, 2024 · 7 comments
Closed

flutter platform ERROR"spawn dart run orm ENOENT" #416

lsxqer opened this issue Aug 25, 2024 · 7 comments

Comments

@lsxqer
Copy link

lsxqer commented Aug 25, 2024

these are my local files

schema.prisma

generator client {
  provider = "dart run orm"
}

datasource db {
  provider = "sqlite"
  url      = env("DATABASE_URL")
}


model User {
  id    Int     @id @default(autoincrement())
  age   Int
  email String  @unique
  name  String?
}

.env

DATABASE_URL="fil:./test.db"
dependencies:
  flutter:
  orm: ^3.4.8

I followed the instructions in the document:

1. dart pub add orm
2. bun prisma init --generator-provider="dart run orm"
3.  bux prisma generate -> error
I encountered an error while executing this command
Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
Error: spawn dart run orm ENOENT

I want to know why this is? Did I use it incorrectly? How should I modify it

@medz
Copy link
Owner

medz commented Aug 25, 2024

@lsxqer Is it Windows? You can try editing schema.prisma and replacing dart with the full path to the specific dart binary file.

The dart command should be a global command, but it doesn't seem to be handled correctly.

@medz
Copy link
Owner

medz commented Aug 25, 2024

@lsxqer
Copy link
Author

lsxqer commented Sep 10, 2024

The command 'dart' is already in the path and is a global command

I used it according to the documentation, but it seems that it is not working properly and cannot generate the code files required by PrismAClient

dart -v
A command-line utility for Dart development.

Usage: dart <command|dart-file> [arguments]

Global options:
-v, --verbose Show additional command output.
--version Print the Dart SDK version.
--enable-analytics Enable analytics.
--disable-analytics Disable analytics.
--suppress-analytics Disallow analytics for this dart * run without changing the analytics configuration.
-h, --help Print this usage information.

Available commands:
analyze Analyze Dart code in a directory.
compile Compile Dart to various formats.
create Create a new Dart project.
devtools Open DevTools (optionally connecting to an existing application).
doc Generate API documentation for Dart projects.
fix Apply automated fixes to Dart source code.
format Idiomatically format Dart source code.
info Show diagnostic information about the installed tooling.
pub Work with packages.
run Run a Dart program.
test Run tests for a project.

Run "dart help " for more information about a command.
See https://dart.dev/tools/dart-tool for detailed documentation.

@medz
Copy link
Owner

medz commented Sep 10, 2024

@lsxqer I'm investigating, Prisma Windows Bun I haven't reproduced it yet, it seems to be related to specific devices and settings.

But I know you followed the documentation step by step, I will look for more devices to find the problem, please wait for me.

@medz
Copy link
Owner

medz commented Sep 10, 2024

@lsxqer Can you provide me your Bun version number?

@medz
Copy link
Owner

medz commented Sep 10, 2024

orm: ^3.4.8

@lsxqer I noticed that your orm version number is 3.4.8. The problem is found, please change the version number to 5.0.5

@medz
Copy link
Owner

medz commented Sep 10, 2024

I don't know what happened, using dart pub add orm installed version 3.x by default! This is weird! Then I manually corrected the version number to 5.0.5 and it still worked!

Repository owner locked and limited conversation to collaborators Sep 10, 2024
@medz medz converted this issue into discussion #422 Sep 10, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants