redwood: Error generating the Prisma client
I am following the tutorial here https://redwoodjs.com/tutorial/installation-starting-development, and am running into an error. Here are my project files (just the generated starter files minus the node_modules folder) and the commands I’ve run:
Project zip: redwoodblog.zip
$ node -v
v13.12.0
$ yarn -v
1.22.4
$ yarn create redwood-app ./redwoodblog
yarn create v1.22.4
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 🔨 Building fresh packages...
success Installed "create-redwood-app@0.4.0" with binaries:
- create-redwood-app
✔ Creating Redwood app
✔ Creating directory '/Users/Andrew/RedwoodJS_Tutorial/redwoodblog'
✔ Downloading latest release
✔ Extracting latest release
✔ Clean up
✔ Installing packages
✔ Checking node and yarn compatibility
✔ Running `yarn install`... (This could take a while)
Thanks for trying out Redwood! We've created your app in '/Users/Andrew/RedwoodJS_Tutorial/redwoodblog'
Inside that directory you can run `yarn rw dev` to start the development server.
✨ Done in 119.41s.
Error Output: yarn rw dev
Click details below to view.
yarn run v1.22.4 $ ‘/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/.bin/rw’ dev ✖ Generating the Prisma client… → info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. Command failed with exit code 1: yarn prisma2 generate Error: Cannot call write after a stream was destroyed error Command failed with exit code 1. $ ‘/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/.bin/prisma2’ generate info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. $ ‘/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/.bin/dev-server’ $ ‘/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/.bin/webpack-dev-server’ --config …/node_modules/@redwoodjs/core/config/webpack.development.js $ ‘/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/.bin/prisma2’ generate --watch 21:39:28 db | Error: Cannot call write after a stream was destroyed error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 21:39:28 db | cd /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api && yarn prisma2 generate --watch exited with code 1 21:39:28 db | cd /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api && yarn prisma2 generate --watch restarted $ ‘/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/.bin/prisma2’ generate --watch 21:39:30 db | Error: Cannot call write after a stream was destroyed error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 21:39:30 db | cd /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api && yarn prisma2 generate --watch exited with code 1 21:39:30 db | cd /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api && yarn prisma2 generate --watch restarted $ ‘/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/.bin/prisma2’ generate --watch 21:39:30 web | ℹ 「wds」: Project is running at http://localhost:8910/ 21:39:30 web | ℹ 「wds」: webpack output is served from / 21:39:30 web | ℹ 「wds」: Content not from webpack is served from /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/web 21:39:30 web | ℹ 「wds」: 404s will fallback to /index.html 21:39:33 db | Error: Cannot call write after a stream was destroyed error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 21:39:33 db | cd /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api && yarn prisma2 generate --watch exited with code 1 21:39:33 db | cd /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api && yarn prisma2 generate --watch restarted 21:39:33 api | /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/@prisma/client/index.js:3 21:39:33 api | throw new Error( 21:39:33 api | ^ 21:39:33 api | 21:39:33 api | Error: @prisma/client did not initialize yet. Please run “prisma2 generate” and try to import it again. 21:39:33 api | In case this error is unexpected for you, please report it in https://github.com/prisma/prisma-client-js/issues/390. 21:39:33 api | at new PrismaClient (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/@prisma/client/index.js:3:11) 21:39:33 api | at Object.<anonymous> (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api/src/lib/db.js:6:19) 21:39:33 api | at Module._compile (internal/modules/cjs/loader.js:1147:30) 21:39:33 api | at Module._compile (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/pirates/lib/index.js:99:24) 21:39:33 api | at Module._extensions…js (internal/modules/cjs/loader.js:1167:10) 21:39:33 api | at Object.newLoader [as .js] (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/pirates/lib/index.js:104:7) 21:39:33 api | at Module.load (internal/modules/cjs/loader.js:996:32) 21:39:33 api | at Function.Module._load (internal/modules/cjs/loader.js:896:14) 21:39:33 api | at Module.require (internal/modules/cjs/loader.js:1036:19) 21:39:33 api | at require (internal/modules/cjs/helpers.js:72:18) error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 21:39:33 api | cd /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api && yarn dev-server exited with code 1 21:39:33 api | cd /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api && yarn dev-server restarted $ ‘/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/.bin/prisma2’ generate --watch $ ‘/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/.bin/dev-server’ 21:39:35 db | Error: Cannot call write after a stream was destroyed error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 21:39:35 db | cd /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api && yarn prisma2 generate --watch exited with code 1 21:39:37 api | /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/@prisma/client/index.js:3 21:39:37 api | throw new Error( 21:39:37 api | ^ 21:39:37 api | 21:39:37 api | Error: @prisma/client did not initialize yet. Please run “prisma2 generate” and try to import it again. 21:39:37 api | In case this error is unexpected for you, please report it in https://github.com/prisma/prisma-client-js/issues/390. 21:39:37 api | at new PrismaClient (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/@prisma/client/index.js:3:11) 21:39:37 api | at Object.<anonymous> (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api/src/lib/db.js:6:19) 21:39:37 api | at Module._compile (internal/modules/cjs/loader.js:1147:30) 21:39:37 api | at Module._compile (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/pirates/lib/index.js:99:24) 21:39:37 api | at Module._extensions…js (internal/modules/cjs/loader.js:1167:10) 21:39:37 api | at Object.newLoader [as .js] (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/pirates/lib/index.js:104:7) 21:39:37 api | at Module.load (internal/modules/cjs/loader.js:996:32) 21:39:37 api | at Function.Module._load (internal/modules/cjs/loader.js:896:14) 21:39:37 api | at Module.require (internal/modules/cjs/loader.js:1036:19) 21:39:37 api | at require (internal/modules/cjs/helpers.js:72:18) error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 21:39:38 api | cd /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api && yarn dev-server exited with code 1 21:39:38 api | cd /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api && yarn dev-server restarted $ ‘/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/.bin/dev-server’ 21:39:43 api | /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/@prisma/client/index.js:3 21:39:43 api | throw new Error( 21:39:43 api | ^ 21:39:43 api | 21:39:43 api | Error: @prisma/client did not initialize yet. Please run “prisma2 generate” and try to import it again. 21:39:43 api | In case this error is unexpected for you, please report it in https://github.com/prisma/prisma-client-js/issues/390. 21:39:43 api | at new PrismaClient (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/@prisma/client/index.js:3:11) 21:39:43 api | at Object.<anonymous> (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api/src/lib/db.js:6:19) 21:39:43 api | at Module._compile (internal/modules/cjs/loader.js:1147:30) 21:39:43 api | at Module._compile (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/pirates/lib/index.js:99:24) 21:39:43 api | at Module._extensions…js (internal/modules/cjs/loader.js:1167:10) at Object.newLoader [as .js] (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/pirates/lib/index.js:104:7) 21:39:43 api | at Module.load (internal/modules/cjs/loader.js:996:32) 21:39:43 api | at Function.Module._load (internal/modules/cjs/loader.js:896:14) 21:39:43 api | at Module.require (internal/modules/cjs/loader.js:1036:19) 21:39:43 api | at require (internal/modules/cjs/helpers.js:72:18) error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 21:39:43 api | cd /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api && yarn dev-server exited with code 1 21:39:43 api | cd /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api && yarn dev-server restarted $ ‘/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/.bin/dev-server’ 21:39:49 api | /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/@prisma/client/index.js:3 21:39:49 api | throw new Error( 21:39:49 api | ^ 21:39:49 api | 21:39:49 api | Error: @prisma/client did not initialize yet. Please run “prisma2 generate” and try to import it again. 21:39:49 api | In case this error is unexpected for you, please report it in https://github.com/prisma/prisma-client-js/issues/390. 21:39:49 api | at new PrismaClient (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/@prisma/client/index.js:3:11) 21:39:49 api | at Object.<anonymous> (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api/src/lib/db.js:6:19) 21:39:49 api | at Module._compile (internal/modules/cjs/loader.js:1147:30) 21:39:49 api | at Module._compile (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/pirates/lib/index.js:99:24) 21:39:49 api | at Module._extensions…js (internal/modules/cjs/loader.js:1167:10) 21:39:49 api | at Object.newLoader [as .js] (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/pirates/lib/index.js:104:7) 21:39:49 api | at Module.load (internal/modules/cjs/loader.js:996:32) 21:39:49 api | at Function.Module._load (internal/modules/cjs/loader.js:896:14) 21:39:49 api | at Module.require (internal/modules/cjs/loader.js:1036:19) 21:39:49 api | at require (internal/modules/cjs/helpers.js:72:18) error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 21:39:49 api | cd /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api && yarn dev-server exited with code 1
</details>
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 3
- Comments: 43 (21 by maintainers)
Hi @TurboTobias,
See this issue: https://github.com/prisma/prisma/issues/1973 From your console output here it seems that the path
Mobile Documentsincludes space. I suggest trying from a new system pathAhh, I see. The videos are pretty old by now. A lot has changed since they were recorded 🙂 Until new videos are produced (which is a lot of work!) I’d recommend you follow the written tutorial instead. It’s much more up to date
Same error for
yarn prisma2 generate👆Tried
yarn rw db upfor funsies and it migrates the database but fails to set up client, “cannot call write after stream was destroyed”.Output
Exactly! I remembered seeing query-engine-windows.exe in your screenshot. And since you’re on Win7 I thought it might be relevant to you 😃
You can ask the Prisma people, but I think they’re just going to tell you the same thing as the dude in that issue I linked - Win7 is not supported.
Yeah, sorry, if things works on something that old it’s more of a happy coincidence than something we have the resources to actively support.
But, if there’s some easy change we can do to make it work for you, we’re happy to fix it 🙂 Just let us know 👍
Thanks, this gives me an idea! I’ll get back to you soon
$ yarn prisma2 migrate up --experimental --create-db(from /api) errors the following