Skip to content

Node module yargs missing from FBReactNativeSpec #36315

@squio

Description

@squio

Description

This is almost the same as #35893 but now in regular build context for iOS in Xcode

React Native Version

0.71.3

Output of npx react-native info

OS: macOS 13.2.1
CPU: (8) arm64 Apple M1
Memory: 77.50 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh

Binaries:
Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
Yarn: 1.22.18 - ~/Library/pnpm/yarn
npm: 8.19.3 - ~/.nvm/versions/node/v18.12.1/bin/npm
Watchman: 2022.10.31.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
Android SDK:
API Levels: 28, 29, 31, 32, 33
Build Tools: 28.0.3, 29.0.2, 30.0.3, 31.0.0, 32.0.0, 33.0.0
System Images: android-29 | ARM 64 v8a, android-29 | Google APIs ARM 64 v8a, android-29 | Google Play ARM 64 v8a, android-31 | ARM 64 v8a, android-31 | Google APIs ARM 64 v8a, android-31 | Google Play ARM 64 v8a, android-32 | Google APIs ARM 64 v8a, android-32 | Google Play ARM 64 v8a, android-33 | Google APIs ARM 64 v8a, android-33 | Google Play ARM 64 v8a
Android NDK: 22.1.7171670
IDEs:
Android Studio: 2022.1 AI-221.6008.13.2211.9477386
Xcode: 14.2/14C18 - /usr/bin/xcodebuild
Languages:
Java: 11.0.17 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: Not Found
react-native: Not Found
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

Steps:

  • upgrade an exiting project from rn 0.71.2 -> 0.71.3
  • remove node_modules
  • remove ios/Pods and ios/Podfile.lock
  • run npm install (all modules are up to date, 0 auditing issues)
  • run pod install in ios directory (all Ponds install successfully)
  • open project in Xcode and build for connected device (iPhone)

Expected result:

  • build completes successfully

Actual result:

  • build fails with error when building FBReactNativeSpec

Work around

Add yargs to the main package,.json:

  • npm install --save yargs

Snack, code example, screenshot, or link to a repository

Error in build step step FBReactNativeSpec

Found '~/.nvmrc' with version <lts/*>
Now using node v18.12.1 (npm v8.19.3)
node:internal/modules/cjs/loader:998
  throw err;
  ^

Error: Cannot find module 'yargs'
Require stack:
- ~/Project/App/node_modules/react-native/scripts/generate-specs-cli.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
    at Module._load (node:internal/modules/cjs/loader:841:27)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (~/Project/App/node_modules/react-native/scripts/generate-specs-cli.js:12:15)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '~/Project/App/node_modules/react-native/scripts/generate-specs-cli.js'
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Triage 🔍StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions