[MODULE_NOT_FOUND] require failed to load

Vincent Eliezer
1 min readJun 8, 2023

[MODULE_NOT_FOUND] require failed to load › /usr/local/lib/node_modules/eas-cli/build/commands/build/index.js: Cannot find module › ‘@expo/steps’ › Require stack: › — /usr/local/lib/node_modules/eas-cli/build/project/customBuildConfig.js › — /usr/local/lib/node_modules/eas-cli/build/build/runBuildAndSubmit.js › — /usr/local/lib/node_modules/eas-cli/build/commands/build/index.js › — /usr/local/lib/node_modules/eas-cli/node_modules/@oclif/core/lib/module-loader.js › — /usr/local/lib/node_modules/eas-cli/node_modules/@oclif/core/lib/config/plugin.js › — /usr/local/lib/node_modules/eas-cli/node_modules/@oclif/core/lib/config/config.js › — /usr/local/lib/node_modules/eas-cli/node_modules/@oclif/core/lib/config/index.js › — /usr/local/lib/node_modules/eas-cli/node_modules/@oclif/core/lib/command.js › — /usr/local/lib/node_modules/eas-cli/node_modules/@oclif/core/lib/index.js › — /usr/local/lib/node_modules/eas-cli/bin/run › Code: MODULE_NOT_FOUND

How to solve this error;

Install expo globally

npm install -g eas-cli

Probably you may encounter the following error;

ENOTEMPTY: directory not empty, rename ‘/usr/local/lib/node_modules/eas-cli’ -> ‘/usr/local/lib/node_modules/.eas-cli-JnPBAwa0’

The error message you encountered, “ENOTEMPTY: directory not empty,” indicates that there was an issue when trying to rename a directory during the installation of the eas-cli package. The error suggests that the directory /usr/local/lib/node_modules/eas-cli could not be renamed because it is not empty.

To resolve this issue, you can try the following steps:

  1. Close any open terminals or processes that might be using the eas-cli package.
  2. Manually delete the /usr/local/lib/node_modules/.eas-cli-JnPBAwa0 directory if it exists. Use the following command in your terminal:
sudo rm -rf /usr/local/lib/node_modules/.eas-cli-JnPBAwa0

3. Retry the installation of eas-cli globally by running the following command:

npm install -g eas-cli

I hope this solves your problem!!

--

--

Vincent Eliezer

Software Engineer | Infinitely curious, constantly building android & web solutions | Twitter @vincenteliezer