You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wrong path — typo in import path or wrong relative/absolute path
Wrong casing — import Button from './button' but file is Button.jsx
Path alias not configured — @/ alias not set up in bundler
Detailed Solution
Solution 1: Package Not Installed
# Check if it's in package.json
cat package.json | grep express
# Install it
npm install express # production dependency
npm install --save-dev jest # dev dependency# Or reinstall everything
rm -rf node_modules package-lock.json
npm install
Solution 2: Wrong Path
// ❌ Wrong relative pathimport{helper}from'../utils';// file is at ./utilsimportButtonfrom'./components/btn';// file is Button.jsx// Correctimport{helper}from'./utils';importButtonfrom'./components/Button';// Debug: check the actual file pathfind.-name "Button*" -not -path "*/node_modules/*"
// ❌ CommonJS require in ESM projectconstexpress=require('express');// error if "type":"module" in package.json// Use importimportexpressfrom'express';// Or add to package.json to use CommonJS:{"type": "commonjs"}
Prevention
Always run npm install after cloning a repo
Use IDE path autocompletion to avoid typos
Check file casing on case-sensitive systems (Linux servers)