Claudio Ferraro
Claudio Ferraro

Reputation: 4721

Unable to resolve "../lib/util" from "node_modules\react-native-svg\elements\Text.js"

I did some mess with the dependencies and installed the react-native-svg again even if expo already had. So i got the error while starting my application:

Unable to resolve "../lib/util" from "node_modules\react-native- 
svg\elements\Text.js"

No matter what my source code is. I tried so far to remove and reinstall the expo-cli

npm install expo-cli --global

I tried to remove manually the node_modules folder of the npm install on my computer and from my project folder

I tried to remove completely the project folder and to recreate a new project with the same name

But now even on clean project and after expo-cli reinstall I get the error above.

I'm lost in space

Upvotes: 1

Views: 895

Answers (1)

Andrew
Andrew

Reputation: 28539

I’ve discovered that if you accidentally install a dependency that already exists in Expo this is the simplest way to get things running again:

  1. Close all terminals running Expo
  2. Close the browser window running Expo
  3. Clear the project you were working on from the Expo app on your device.
  4. Delete your package-lock.json
  5. Delete your node_modules folder
  6. Remove the dependency/dependencies that you shouldn’t have added from your package.json
  7. Run npm i
  8. Restart Expo using expo start -c

Upvotes: 2

Related Questions