npm / npm/cli

[BUG] MODULE_NOT_FOUND

Open
#7,112 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Needs Triage Release 10.x
Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

Description

Is there an existing issue for this?
  • I have searched the existing issues
This issue exists in the latest npm version
  • 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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The report names no repository file, test, or entry point; begin by reproducing npx prisma and npx prisma generate from the src workspace in a Turbo monorepo. Trace how npm resolves the Prisma executable and compare the workspace dependency layout, then verify that both commands run without MODULE_NOT_FOUND.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.