2
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.

1 Answer 1

2

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

npm install util

Sign up to request clarification or add additional context in comments.

4 Comments

can you clarify how this solves the issue? we are seeing this issue happen in our CI environment, but locally our react-native builds/runs android without issue
I have copied the file from my running project to the project that was causing issue. and it solved my problem.
@AftabAmin if my answer fixes your issue please mark it as the answer.
I will check this, and if solves my issue. then will definite mark it as accepted and will upvote it.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.