Engr.Aftab Ufaq
Engr.Aftab Ufaq

Reputation: 6464

react native unable to resolve module util

react native version 63.4 
node version 14.17.5

Error: Unable to resolve module util from D:\Repos\Socket\node_modules\bson\dist\bson.browser.umd.js: util could not be found within the project.

If you are sure the module exists, try these steps:

  1. Clear watchman watches: watchman watch-del-all
  2. Delete node_modules and run yarn install
  3. Reset Metro's cache: yarn start --reset-cache
  4. Remove the cache: rm -rf /tmp/metro-*

var customInspectSymbol = typeof Symbol === 'function' && typeof Symbol['for'] === 'function' ? // eslint-disable-line dot-notation Symbol'for' // eslint-disable-line dot-notation ^ : null;

I installed new version of the npm and after run npx react-native run-andorid getting this issue.

Upvotes: 2

Views: 3796

Answers (1)

Musab.BA
Musab.BA

Reputation: 431

The solution is to run this command and it will be fixed

npm install util

Upvotes: 2

Related Questions