npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

Error: Cannot find module

If when running npm (not your application), you get an error about a module not being found, this almost certainly means that there’s something wrong with your npm installation.

If this happens when trying to start your application, you might not have installed your package’s dependencies yet.

Examples

module.js:338
    throw err;
          ^
Error: Cannot find module

Related Issues


Steps to Fix

  1. If this happens when you try to start your application, try running npm install to install the app’s dependencies. Make sure all its actual dependencies are listed in package.json

  2. If this happens on any npm command, please reinstall.