facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
119.26k stars 24.35k forks source link

Node module `yargs` missing from `FBReactNativeSpec` #36315

Closed squio closed 1 year ago

squio commented 1 year ago

Description

This is almost the same as https://github.com/facebook/react-native/issues/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:

Expected result:

Actual result:

Work around

Add yargs to the main package,.json:

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'
  ]
}
cortinico commented 1 year ago

This should fix this issue as well:

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stalled for 7 days with no activity.