Prisma1: internal/modules/cjs/loader.js:594 Error: Cannot find module 'generate'

Created on 10 Nov 2018  Â·  17Comments  Â·  Source: prisma/prisma1

Describe the bug
Can not initialize with prisma via Homebrew
To Reproduce
Steps to reproduce the behavior:
New installed macOS Mojave, install homebrew, install prisma via homebrew, install Docker CE, signed in Docker, run prisma init abc, choose all options, throw Error.

Expected behavior
It should work as well as prisma installed with npm
Screenshots
image

Versions (please complete the following information):

  • OS: macOS Mojave
  • Latest Prisma
bu2-confirmed arecli arebrew

Most helpful comment

The quick solution using brew is to run prisma generate manually and all will work fine.

Another solution is to uninstall prisma from brew and reinstall using npm:

brew uninstall prisma
npm i -g prisma
prisma init hello-world

All 17 comments

Thanks for reporting @ducdev ! What's the output of prisma -v?

I have the same problem with same config and same steps. Output of prisma -v is prisma/1.20 (darwin-x64) node-v10.4.1

I can confirm that I can reproduce this issue on version prisma/1.21.0 (darwin-x64) node-v10.4.1

screenshot 2018-12-03 at 11 54 55 pm

This issue occurs when you wanted to generate one of the prisma clients.

This is now fixed in #3656

Having the exact same issue with prisma/1.24.0 (darwin-x64) node-v10.4.1 running brew version on Mojave.

Using npm version works fine.

I have same error, after I added hook to prisma.yml

hooks:
  post-deploy:
    - prisma generate

If I run prisma generate manually — all fine.

macOS Mojave, brew, prisma/1.24.0, node-v10.4.1

Same issue here. macOS Mojave, brew, prisma/1.24.0, node-v10.15.0

It works fine when you use the npm version of prisma. Also the brew installed version adds a very old prisma version to the docker-compose file. I think we should avoid the brew version for now.

The issue is still not fixed.

The issue is still there with: prisma/1.29.1 (windows-x64) node-v10.15.3:
internal/modules/cjs/loader.js:584
throw err;
^

Error: Cannot find module './generated/prisma-client'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
...

This issue still exists in prisma 1.30.x when prisma is installed with homebrew. When installed with npm the issue becomes nonexistent

same here

C:\Users\SYSTEM1>ng
internal/modules/cjs/loader.js:584
throw err;
^

Error: Cannot find module 'symbol-observable'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object. (C:\Users\SYSTEM1\AppData\Roaming\npmnode_modules\@an
gular\clilib\init.js:10:1)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)

please provide the solution

Just tried this with Prisma CLI version: prisma/1.33.0 (darwin-x64) node-v10.4.1

The error

Next steps:

  1. Start your Prisma server: docker-compose up -d
  2. Deploy your Prisma service: prisma deploy
  3. Read more about introspection:
     http://bit.ly/prisma-introspection
internal/modules/cjs/loader.js:594
    throw err;
    ^

Error: Cannot find module '/Users/isengard/Dev/str/pw20190516/generate'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:592:15)
    at Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1285:46)
    at Function.Module._load (internal/modules/cjs/loader.js:518:25)
    at Function.Module.runMain (pkg/prelude/bootstrap.js:1314:12)
    at startup (internal/bootstrap/node.js:274:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:608:3)

The quick solution using brew is to run prisma generate manually and all will work fine.

Another solution is to uninstall prisma from brew and reinstall using npm:

brew uninstall prisma
npm i -g prisma
prisma init hello-world

Ran into this issue and ^ worked perfectly for me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sorenbs picture sorenbs  Â·  43Comments

blocka picture blocka  Â·  74Comments

schickling picture schickling  Â·  44Comments

marktani picture marktani  Â·  44Comments

marktani picture marktani  Â·  35Comments