cli icon indicating copy to clipboard operation
cli copied to clipboard

[BUG] MODULE_NOT_FOUND

Open martinez-hugo opened this issue 2 years ago • 7 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

This issue exists in the latest npm version

  • [X] I am using the latest npm

Current Behavior

When I run any prisma command, I have this error :

node:internal/modules/cjs/loader:1147
  throw err;
  ^

Error: Cannot find module '/Users/hugomartinez/veille-360/node_modules/src/node_modules/prisma/build/index.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
    at node:internal/main/run_main_module:28:49 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Expected Behavior

No response

Steps To Reproduce

A monorepo managed with turbo My workspace that use prisma is src

prisma deps is added as dev dependency in src package.json file

And so I run npx prismaor npx prisma generate in src directory and that's not works

Environment

  • npm: 10.2.5
  • Node.js: v20.10.0
  • OS Name: MacOS
  • System Model Name: MacBook Pro Apple M1 Pro
  • npm config:
; "user" config from /Users/hugomartinez/.npmrc

@lareservetech:registry = "https://npm.pkg.github.com/" 
@LaReserveTech:registry = "https://npm.pkg.github.com/" 
@martinez-hugo:registry = "https://npm.pkg.github.com/" 
//npm.pkg.github.com/:_authToken = (protected) 
engine-strict = true 

; node bin location = /usr/local/bin/node
; node version = v20.10.0
; npm local prefix = /Users/hugomartinez/veille-360
; npm version = 10.2.5
; cwd = /Users/hugomartinez/veille-360
; HOME = /Users/hugomartinez
; Run `npm config ls -l` to show all defaults.

martinez-hugo avatar Dec 31 '23 11:12 martinez-hugo

Have you ran npm install?

ljharb avatar Dec 31 '23 15:12 ljharb

Yes Hugo MartinezLe 31 déc. 2023 à 16:20, Jordan Harband @.***> a écrit : Have you ran npm install?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

martinez-hugo avatar Dec 31 '23 15:12 martinez-hugo

You have a node_modules inside src, but src is inside another node_modules, which doesn’t make sense.

ljharb avatar Dec 31 '23 15:12 ljharb

It’s normal in case of usage of turbo I think Because in case of using Turbo, workspaces are considered as pkgHugo MartinezLe 31 déc. 2023 à 16:25, Jordan Harband @.***> a écrit : You have a node_modules inside src, but src is inside another node_modules, which doesn’t make sense.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

martinez-hugo avatar Dec 31 '23 15:12 martinez-hugo

Sounds like an issue with turbo then, which I’m not familiar with.

ljharb avatar Dec 31 '23 15:12 ljharb

I'm assuming you are using TurboRepo. https://turbo.build/repo/docs/handbook/tools/prisma

hkbertoson avatar Jan 03 '24 03:01 hkbertoson

We are facing similar issue with npx -y rimraf on some particular directories, its not case-sensitive file system. Screenshot 2024-01-18 at 16 52 39

64BitAsura avatar Jan 18 '24 15:01 64BitAsura