Skip to content

Cannot find module './xcode' #1912

Closed
Closed

Description

@benlieb

Environment

Run react-native info returns same error:

npx react-native info
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module './xcode'
Require stack:

Description

pod install: 

Error: Cannot find module './xcode'
Require stack:
- /Users/user/myapp/node_modules/@react-native-community/cli-doctor/build/tools/healthchecks/index.js

The basic init doesn't finish installing. I've tried with a number of version of react-native, and none work. It was working last week when I installed a sample app.

 npx react-native@0.71.3 init beatsperminute --version 0.71.3

I can in fact see that ./xcode is not in the build dir:

    ▾ [   ]�cli-doctor/
      ▾ [   ]�build/
        ▸ [   ]�commands/
        ▾ [   ]�tools/
          ▾ [   ]�healthchecks/
              [   ]�androidHomeEnvVariable.d.ts
              [   ]�androidHomeEnvVariable.d.ts.map
              [   ]�androidHomeEnvVariable.js
              [   ]�androidHomeEnvVariable.js.map
              [   ]�androidNDK.d.ts
              [   ]�androidNDK.d.ts.map
              [   ]�androidNDK.js
              [   ]�androidNDK.js.map
              [   ]�androidSDK.d.ts
              [   ]�androidSDK.d.ts.map
              [   ]�androidSDK.js
              [   ]�androidSDK.js.map
              [   ]�androidStudio.d.ts
              [   ]�androidStudio.d.ts.map
              [   ]�androidStudio.js
              [   ]�androidStudio.js.map
              [   ]�cocoaPods.d.ts
              [   ]�cocoaPods.d.ts.map
              [   ]�cocoaPods.js
              [   ]�cocoaPods.js.map
              [   ]�common.d.ts
              [   ]�common.d.ts.map
              [   ]�common.js
              [   ]�common.js.map
              [   ]�index.d.ts
              [   ]�index.d.ts.map
              [   ]�index.js
              [   ]�index.js.map
              [   ]�iosDeploy.d.ts
              [   ]�iosDeploy.d.ts.map
              [   ]�iosDeploy.js
              [   ]�iosDeploy.js.map
              [   ]�jdk.d.ts
              [   ]�jdk.d.ts.map
              [   ]�jdk.js
              [   ]�jdk.js.map
              [   ]�nodeJS.d.ts
              [   ]�nodeJS.d.ts.map
              [   ]�nodeJS.js
              [   ]�nodeJS.js.map
              [   ]�packageManagers.d.ts
              [   ]�packageManagers.d.ts.map
              [   ]�packageManagers.js
              [   ]�packageManagers.js.map
              [   ]�watchman.d.ts
              [   ]�watchman.d.ts.map
              [   ]�watchman.js
              [   ]�watchman.js.map

Activity

  1. benlieb commented on Apr 15, 2023

    @benlieb
    Author

    Hm, re-installing with npm this time (not yarn) the files are there.

  2. benlieb commented on Apr 15, 2023

    @benlieb
    Author

    So confused by this. I had to use init --npm to get this to work.

    Don't understand why installing with npm would be different from yarn, but it is the case.

  3. adamTrz commented on May 11, 2023

    @adamTrz
    Collaborator

    Glad it worked!
    We're working on solution to bypass this weird behaviour of yarn and npx, for now adding --npm should work tho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions