Skip to content

error: Error: Unable to resolve module process #63

@forge-phap-dinh

Description

@forge-phap-dinh

I am using react native 0.66 and after I import the shim file and run the app I get this error

error: Error: Unable to resolve module process ...

process could not be found within the project or in these directories:
node_modules

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-*
    1 | if (typeof __dirname === 'undefined') global.__dirname = '/'
    2 | if (typeof __filename === 'undefined') global.__filename = ''

3 | if (typeof process === 'undefined') {
| ^
4 | global.process = require('process')
5 | } else {
6 | const bProcess = require('process')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions