npm / cli

the package manager for JavaScript
https://docs.npmjs.com/cli/
Other
8.46k stars 3.15k forks source link

[BUG] MODULE_NOT_FOUND #7112

Open martinez-hugo opened 10 months ago

martinez-hugo commented 10 months ago

Is there an existing issue for this?

This issue exists in the latest npm version

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

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

ljharb commented 10 months ago

Have you ran npm install?

martinez-hugo commented 10 months ago

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: @.***>

ljharb commented 10 months ago

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

martinez-hugo commented 10 months ago

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: @.***>

ljharb commented 10 months ago

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

hkbertoson commented 10 months ago

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

64BitAsura commented 9 months ago

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