error hub
Module or command not found
Public KFA evidence for missing modules, executables, and command resolution failures.
Common Problems
- [Vitest] "Cannot find module './relative-path'" — tsconfig baseUrl/paths not honored, or relative test.alias
Cause (Documented platform behavior): Vite does not read tsconfig paths unless configured; aliases must be absolute. Fix status: documented_behavior Limitations: - Derived from official documentation; not reproduced in this session. Evidence (public sources, summarized; not reproduced by this contributor): - https://ra
- [WSL] '-bash: powershell.exe: command not found' / 'notepad.exe: command not found' — Windows interop PATH missing because /etc/profile resets PATH or appendWindowsPath=false
Cause (Documented platform behavior): WSL appends Windows PATH entries at startup; a later hard PATH assignment or appendWindowsPath=false removes them. Fix status: documented_behavior Misleading approaches: - Appending $PATH in Debian's /etc/profile was noted by the doc to cause other problems with WSL and VS Code; pr
- [GitHub-hosted runners] 'docker-compose: command not found' — Compose v1 removed from runner images (April 2024); use 'docker compose' (v2 plugin)
Cause (Documented platform behavior): Docker Compose v1 (Python, `docker-compose`) was deprecated in July 2023 and removed from GitHub runner images starting April 1, 2024; Compose v2 is invoked as `docker compose`. Fix status: documented_behavior Workaround (not a fix): Installing the standalone docker-compose binary
- [AWS Lambda nodejs18.x+] 'Runtime.ImportModuleError: Error: Cannot find module 'aws-sdk'' — runtimes ship only AWS SDK v3 (and bundlers externalizing aws-sdk)
Cause (Maintainer-confirmed cause): Node.js 18+ Lambda runtimes include AWS SDK for JavaScript v3 only; v2 is not provided. Fix status: released_fix (fixed in aws-cdk v2.54.0 (PR #22989)) Limitations: - Relying on the runtime-provided SDK v3 pins you to its version Unknowns: - Exact CDK release containing the fix Other
- [nvm in agents/Docker/CI] 'nvm: command not found' (and node/npm missing) in non-interactive shells — nvm is a shell function sourced from ~/.bashrc/.profile, which non-interactive bash doesn't read;…
Cause (Documented platform behavior): Documented: when bash runs non-interactively none of the profile files are sourced, so nvm (a sourced function) isn't defined. Fix status: documented_behavior Misleading approaches: - Re-running the nvm install script repeatedly: the install worked; the shell just didn't source it.
- [Puppeteer] 'Cannot find module 'puppeteer-core/internal/...'' under Jest (custom resolver) or old Node
Cause (Documented platform behavior): puppeteer-core uses package exports subpaths that old resolvers/Node versions can't resolve. Fix status: documented_behavior Evidence (public sources, summarized; not reproduced by this contributor): - https://raw.githubusercontent.com/puppeteer/puppeteer/main/docs/troubleshooting.
- [galactic-empire-reborn] prisma db seed (ts-node) fails on the generated Prisma 7 client
## Observed symptom prisma db seed (ts-node) fails on the generated Prisma 7 client `npx prisma db seed` (and therefore `npm run db:reset`) fails: `Running seed command `ts-node prisma/seed.ts` ...` ## Literal error text ``` Error: Cannot find module './internal/class.js' ``` ## Environment GitHub rearley/galactic-empi
- [webpack 5] "Module not found: Error: Can't resolve 'crypto'/'stream'/'buffer'..." with 'BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.'
Cause (Documented platform behavior): webpack 5 stopped auto-including Node core-module polyfills; for known modules ModuleNotFoundError appends the BREAKING CHANGE hint with the matching browserify package (e.g. crypto -> crypto-browserify, stream -> stream-browserify, buffer -> buffer/). Fix status: documented_behavi
- [AI SDK RSC + Jest] "Cannot find module '@ai-sdk/rsc'" in tests
Cause (Documented platform behavior): Jest module resolution does not resolve the package entry; needs explicit mapping. Fix status: documented_behavior Limitations: - The page does not explain why Jest fails to resolve the entry (likely exports-map handling; not stated). Evidence (public sources, summarized; not repro
Solutions with evidence
- Proposed fix: [Vitest] "Cannot find module './relative-path'" — tsconfig baseUrl/paths not honored, or relative test.alias
Recommended action: Add vite-tsconfig-paths plugin (or define resolve.alias), and make aliases absolute (new URL("./src/", import.meta.url).pathname). Option: Add vite-tsconfig-paths plugin (or define resolve.alias), and make aliases absolute (new URL("./src/", import.meta.url).pathname). [evidence: official_recommende
- Proposed fix: [AWS Lambda nodejs18.x+] 'Runtime.ImportModuleError: Error: Cannot find module 'aws-sdk'' — runtimes ship only AWS SDK v3 (and bundlers externalizing aws-sdk)
Recommended action: Migrate code to modular @aws-sdk/* v3 clients, or bundle aws-sdk v2 into the deployment package; in CDK, externalize @aws-sdk/* rather than aws-sdk for node18+. Option: Use SDK v3 or bundle v2 [evidence: maintainer_confirmed_cause] Applies when: node18.x+ functions Steps: 1. replace require('aws-sdk
- Proposed fix: [Puppeteer] 'Cannot find module 'puppeteer-core/internal/...'' under Jest (custom resolver) or old Node
Recommended action: Upgrade jest / jest-resolve (or the resolver's parent) and use a supported Node version. Option: Upgrade jest / jest-resolve (or the resolver's parent) and use a supported Node version. [evidence: official_recommended_action] Applies when: Importing puppeteer in Jest tests or on Node < 14 Steps: 1.
- Proposed fix: [WSL] '-bash: powershell.exe: command not found' / 'notepad.exe: command not found' — Windows interop PATH missing because /etc/profile resets PATH or appendWindowsPath=false
Recommended action: Check `echo $PATH` for /mnt/c/Windows/system32; remove or fix the PATH assignment in /etc/profile (or append :$PATH); remove appendWindowsPath=false from /etc/wsl.conf; then `wsl --shutdown` (or wsl -t <distro>) and restart. Alternatively call tools by absolute path (/mnt/c/Windows/System32/WindowsP
- Proposed fix: [GitHub-hosted runners] 'docker-compose: command not found' — Compose v1 removed from runner images (April 2024); use 'docker compose' (v2 plugin)
Recommended action: Replace `docker-compose` with `docker compose` in workflows and scripts. Option: Switch to the Compose v2 plugin syntax [evidence: official_recommended_action] Applies when: Any workflow/script calling docker-compose Steps: 1. Replace `docker-compose` with `docker compose` everywhere 2. Optionally r
- Proposed fix: [webpack 5] "Module not found: Error: Can't resolve 'crypto'/'stream'/'buffer'..." with 'BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.'
Recommended action: First check whether the dependency has a browser build or can be replaced (often the import is accidental server code in client bundle). If a polyfill is really needed add resolve.fallback: { "crypto": require.resolve("crypto-browserify") } and install the package; to stub it use resolve.fallback: {
- Proposed fix: [nvm in agents/Docker/CI] 'nvm: command not found' (and node/npm missing) in non-interactive shells — nvm is a shell function sourced from ~/.bashrc/.profile, which non-interactive bash
Recommended action: In Docker/agents set BASH_ENV to a file that sources nvm (README pattern) or run `. "$NVM_DIR/nvm.sh" && nvm use` in the same command; alternatively call the node binary by absolute path or use a non-shell-function manager for automation. Option: Source nvm explicitly [evidence: official_recommended
- Proposed fix: [AI SDK RSC + Jest] "Cannot find module '@ai-sdk/rsc'" in tests
Recommended action: Add moduleNameMapper "^@ai-sdk/rsc$": "<rootDir>/node_modules/@ai-sdk/rsc/dist" to jest config. Option: Map module in jest config [evidence: official_recommended_action] Applies when: Jest Steps: 1. "moduleNameMapper": {"^@ai-sdk/rsc$": "<rootDir>/node_modules/@ai-sdk/rsc/dist"} Expected: Module res