prisma1 icon indicating copy to clipboard operation
prisma1 copied to clipboard

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

Open ducdev opened this issue 8 years ago • 17 comments

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

ducdev avatar Nov 10 '18 13:11 ducdev

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

timsuchanek avatar Nov 13 '18 17:11 timsuchanek

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

jalmaas avatar Nov 14 '18 11:11 jalmaas

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.

pantharshit00 avatar Dec 03 '18 18:12 pantharshit00

This is now fixed in #3656

pantharshit00 avatar Dec 18 '18 12:12 pantharshit00

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.

Maxximus007 avatar Jan 15 '19 15:01 Maxximus007

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

Krknv avatar Jan 15 '19 17:01 Krknv

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

THPubs avatar Jan 16 '19 04:01 THPubs

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.

THPubs avatar Jan 16 '19 04:01 THPubs

The issue is still not fixed.

dhnm avatar Mar 10 '19 13:03 dhnm

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) ...

huyqpham avatar Mar 25 '19 09:03 huyqpham

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

kenigbolo avatar Apr 06 '19 23:04 kenigbolo

same here

rares-lupascu avatar Apr 14 '19 10:04 rares-lupascu

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\npm\node_modules@an gular\cli\lib\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)

jagadeeshreddy2018 avatar May 02 '19 17:05 jagadeeshreddy2018

please provide the solution

jagadeeshreddy2018 avatar May 02 '19 17:05 jagadeeshreddy2018

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)

redaikidoka avatar May 16 '19 13:05 redaikidoka

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

brunolemos avatar May 18 '19 23:05 brunolemos

Ran into this issue and ^ worked perfectly for me.

thatgibbyguy avatar Aug 22 '19 14:08 thatgibbyguy