Expo for Web broken for reasons other than deep scope? "Error: Cannot find module 'eslint'"

Hi.

I’m trying to use Expo for Web. I did manage to get it to work in the past as a test, but it appears to be broken at the moment.

I’ve read Expo Web CLI is broken ? but it doesn’t seem to be the same problem, because I can’t even get expo start --web to work.

When I run expo start --web I get an error saying Error: Cannot find module 'eslint'. I’ve tried searching for what exactly this means and have also tried e.g. adding eslint as a devDependency, but I have not been able to figure out what’s wrong and how to fix it.

I upgraded expo-cli, created a new project and tried there, but I get the same error.

$ expo --version
3.0.2
$ expo init -t tabs --yarn --name test --android-package expo-test --ios-bundle-identifier expo-test expo-test
✔ Please enter a few initial configuration values.
  Read more: https://docs.expo.io/versions/latest/workflow/configuration/ · 100% completed
Extracting project files...
Customizing project...
Initialized a git repository.
Installing dependencies...
yarn install v1.17.3
info No lockfile found.
[1/4] Resolving packages...
warning expo > fbemitter > fbjs > core-js@1.2.7: core-js@<2.6.8 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2.
warning react-native-web > deep-assign@3.0.0: Check out `lodash.merge` or `merge-options` instead.
warning jest-expo > jest > jest-cli > jest-config > jest-environment-jsdom > jsdom > left-pad@1.3.0: use String.prototype.padStart()
[2/4] Fetching packages...
info fsevents@1.2.9: The platform "linux" is incompatible with this module.
info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > @react-navigation/web@1.0.0-alpha.9" has unmet peer dependency "@react-navigation/core@^3.0.0-alpha.13".
warning "expo > react-google-maps@9.4.5" has unmet peer dependency "@types/googlemaps@^3.0.0".
warning "expo > react-google-maps@9.4.5" has unmet peer dependency "@types/markerclustererplus@^2.1.29".
warning "expo > react-google-maps@9.4.5" has unmet peer dependency "@types/react@^15.0.0 || ^16.0.0".
warning "expo > react-native-reanimated@1.0.1" has incorrect peer dependency "react@16.0.0-alpha.6".
warning "expo > react-native-reanimated@1.0.1" has incorrect peer dependency "react-native@^0.44.1".
warning "react-native > metro-react-native-babel-transformer@0.51.0" has unmet peer dependency "@babel/core@*".
warning "react-native > @react-native-community/cli > metro-react-native-babel-transformer@0.51.1" has unmet peer dependency "@babel/core@*".
warning "react-navigation > react-navigation-stack@1.4.0" has unmet peer dependency "react-native-gesture-handler@^1.0.0".
warning "react-navigation > react-navigation-stack@1.4.0" has unmet peer dependency "react-native-screens@^1.0.0 || ^1.0.0-alpha".
warning "react-navigation > react-navigation-tabs@1.1.4" has unmet peer dependency "react-native-screens@^1.0.0 || ^1.0.0-alpha".
warning "react-navigation > react-navigation-drawer@1.2.1" has unmet peer dependency "react-native-gesture-handler@^1.0.12".
warning "react-navigation > react-navigation-drawer@1.2.1" has unmet peer dependency "react-native-screens@^1.0.0 || ^1.0.0-alpha".
warning "react-navigation > @react-navigation/native@3.5.0" has unmet peer dependency "react-native-gesture-handler@*".
warning "jest-expo > babel-jest@24.8.0" has unmet peer dependency "@babel/core@^7.0.0".
warning "jest-expo > babel-jest > babel-preset-jest@24.6.0" has unmet peer dependency "@babel/core@^7.0.0".
[4/4] Building fresh packages...
success Saved lockfile.
Done in 125.96s.

Your project is ready at /tmp/expo-test

To get started, you can type:

  cd expo-test
  yarn start

$ cd expo-test
$ expo start --web
Starting project at /tmp/expo-test
Expo DevTools is running at http://localhost:19002
Press d to open DevTools now, or shift-d to always open it automatically.
Starting Metro Bundler on port 19004.
Tunnel ready.
Cannot find module 'eslint'
Error: Cannot find module 'eslint'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
    at Function.resolve (internal/modules/cjs/helpers.js:30:19)
    at module.exports (/usr/local/node-v10.13.0-linux-x64/lib/node_modules/expo-cli/node_modules/@expo/webpack-config/webpack/webpack.common.js:448:37)
$ 

I then upgraded node in case that was the problem, but still got the same error. The stack trace was just more verbose.

$ expo start --web
Starting project at /tmp/expo-test
Expo DevTools is running at http://localhost:19002
Press d to open DevTools now, or shift-d to always open it automatically.
Starting Metro Bundler on port 19004.
Tunnel ready.
Cannot find module 'eslint'
Require stack:
- /usr/local/node-v12.6.0-linux-x64/lib/node_modules/expo-cli/node_modules/@expo/webpack-config/webpack/webpack.common.js
- /usr/local/node-v12.6.0-linux-x64/lib/node_modules/expo-cli/node_modules/@expo/webpack-config/webpack/webpack.dev.js
- /usr/local/node-v12.6.0-linux-x64/lib/node_modules/expo-cli/node_modules/@expo/webpack-config/webpack.config.js
- /usr/local/node-v12.6.0-linux-x64/lib/node_modules/expo-cli/node_modules/@expo/xdl/build/Web.js
- /usr/local/node-v12.6.0-linux-x64/lib/node_modules/expo-cli/node_modules/@expo/xdl/build/createWebpackCompiler.js
- /usr/local/node-v12.6.0-linux-x64/lib/node_modules/expo-cli/node_modules/@expo/xdl/build/Webpack.js
- /usr/local/node-v12.6.0-linux-x64/lib/node_modules/expo-cli/node_modules/@expo/xdl/build/Project.js
- /usr/local/node-v12.6.0-linux-x64/lib/node_modules/expo-cli/node_modules/@expo/xdl/build/xdl.js
- /usr/local/node-v12.6.0-linux-x64/lib/node_modules/expo-cli/build/exp.js
- /usr/local/node-v12.6.0-linux-x64/lib/node_modules/expo-cli/bin/expo.js
Error: Cannot find module 'eslint'
Require stack:
- /usr/local/node-v12.6.0-linux-x64/lib/node_modules/expo-cli/node_modules/@expo/webpack-config/webpack/webpack.common.js
- /usr/local/node-v12.6.0-linux-x64/lib/node_modules/expo-cli/node_modules/@expo/webpack-config/webpack/webpack.dev.js
- /usr/local/node-v12.6.0-linux-x64/lib/node_modules/expo-cli/node_modules/@expo/webpack-config/webpack.config.js
- /usr/local/node-v12.6.0-linux-x64/lib/node_modules/expo-cli/node_modules/@expo/xdl/build/Web.js
- /usr/local/node-v12.6.0-linux-x64/lib/node_modules/expo-cli/node_modules/@expo/xdl/build/createWebpackCompiler.js
- /usr/local/node-v12.6.0-linux-x64/lib/node_modules/expo-cli/node_modules/@expo/xdl/build/Webpack.js
- /usr/local/node-v12.6.0-linux-x64/lib/node_modules/expo-cli/node_modules/@expo/xdl/build/Project.js
- /usr/local/node-v12.6.0-linux-x64/lib/node_modules/expo-cli/node_modules/@expo/xdl/build/xdl.js
- /usr/local/node-v12.6.0-linux-x64/lib/node_modules/expo-cli/build/exp.js
- /usr/local/node-v12.6.0-linux-x64/lib/node_modules/expo-cli/bin/expo.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:625:15)
    at Function.resolve (internal/modules/cjs/helpers.js:21:19)
    at module.exports (/usr/local/node-v12.6.0-linux-x64/lib/node_modules/expo-cli/node_modules/@expo/webpack-config/webpack/webpack.common.js:448:37)
    at module.exports (/usr/local/node-v12.6.0-linux-x64/lib/node_modules/expo-cli/node_modules/@expo/webpack-config/webpack/webpack.dev.js:15:16)
    at module.exports (/usr/local/node-v12.6.0-linux-x64/lib/node_modules/expo-cli/node_modules/@expo/webpack-config/webpack.config.js:16:14)
    at Object.invokeWebpackConfigAsync (/@expo/xdl@56.1.1/src/Web.js:92:14)
    at startAsync (/@expo/xdl@56.1.1/src/Webpack.js:66:18)
    at Object.openAsync (/@expo/xdl@56.1.1/src/Webpack.js:235:5)
    at Object.handleMobileOptsAsync (/expo-cli@3.0.2/src/urlOpts.ts:96:5)
    at action (/expo-cli@3.0.2/src/commands/start.js:89:3)
$ 

Am I doing something wrong?

@wodin, yeah, the eslint issue was a different issue which has since been fixed. Try updating to the latest expo-cli version: https://www.npmjs.com/package/expo-cli

Yes, thanks, it works after updating expo-cli.