This is a weird issue which started showing up in last few days on a project in which nothing changed.
$expo start
Cannot find module 'to-regex-range'
Require stack:
- /usr/local/lib/node_modules/expo-cli/node_modules/fill-range/index.js
- /usr/local/lib/node_modules/expo-cli/node_modules/braces/lib/compile.js
- /usr/local/lib/node_modules/expo-cli/node_modules/braces/index.js
- /usr/local/lib/node_modules/expo-cli/node_modules/micromatch/index.js
- /usr/local/lib/node_modules/expo-cli/node_modules/fast-glob/out/utils/pattern.js
- /usr/local/lib/node_modules/expo-cli/node_modules/fast-glob/out/utils/index.js
- /usr/local/lib/node_modules/expo-cli/node_modules/fast-glob/out/managers/tasks.js
- /usr/local/lib/node_modules/expo-cli/node_modules/fast-glob/out/index.js
- /usr/local/lib/node_modules/expo-cli/node_modules/globby/index.js
- /usr/local/lib/node_modules/expo-cli/node_modules/@expo/config/build/Config.js
- /usr/local/lib/node_modules/expo-cli/node_modules/@expo/config/build/index.js
- /usr/local/lib/node_modules/expo-cli/build/commands/start.js
- /usr/local/lib/node_modules/expo-cli/build/commands/index.js
- /usr/local/lib/node_modules/expo-cli/build/exp.js
- /usr/local/lib/node_modules/expo-cli/bin/expo.js
Nothing changed in this project.
I have tried removing yarn.lock and running “yarn add expo”, after which the expo start works.
However, next day I get into the same issue. Today even after trying various options this problem is persisting and I am unable to start the project.
Here is expo diagnostics output
$expo diagnostics
Expo CLI 3.21.3 environment info:
System:
OS: macOS 10.15.5
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 14.3.0 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.4 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
IDEs:
Xcode: 11.5/11E608c - /usr/bin/xcodebuild
npmPackages:
expo: ^37.0.12 => 37.0.12
react: 16.9.0 => 16.9.0
react-dom: ^16.13.1 => 16.13.1
react-native: https://github.com/expo/react-native/archive/sdk-37.0.0.tar.gz => 0.61.4
react-native-web: ^0.12.2 => 0.12.2
react-navigation: ^4.1.0 => 4.3.9
npmGlobalPackages:
expo-cli: 3.21.3