Common causes
- The package isn't installed — run npm install
- The import path is missing the file extension (.js is required in ESM)
- Importing a relative file without including .js: import './utils' should be import './utils.js'
- A package was removed from node_modules but is still referenced in code
How to fix it
- Install missing packages: npm install <package-name>
- Add .js extension to local imports: change import './helper' to import './helper.js'
- Delete node_modules and reinstall: rm -rf node_modules && npm install
- Check that the package name in the import matches exactly what's in package.json
Example
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/user/project/src/utils' imported from /home/user/project/src/index.js
Did you mean to import ../utils/index.js?Using ESM import without the .js extension on a local file path
Have a different error?
Paste any error message into the Error Translator to get an instant explanation.
