Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module './xcode' #1912

Closed
benlieb opened this issue Apr 15, 2023 · 3 comments
Closed

Cannot find module './xcode' #1912

benlieb opened this issue Apr 15, 2023 · 3 comments

Comments

@benlieb
Copy link

benlieb commented Apr 15, 2023

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
@benlieb
Copy link
Author

benlieb commented Apr 15, 2023

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

@benlieb
Copy link
Author

benlieb commented Apr 15, 2023

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.

@adamTrz
Copy link
Collaborator

adamTrz commented May 11, 2023

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

@adamTrz adamTrz closed this as completed May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants