Skip to content

Pnpm package manager iOS ARCHIVE FAILED (Cannot find module '@sentry/cli/package.json') #4939

@qnrjs42

Description

@qnrjs42

What React Native libraries do you use?

Hermes

Are you using sentry.io or on-premise?

sentry.io (SaS)

@sentry/react-native SDK Version

6.15.1

How does your development environment look like?

⬇  Place the `npx react-native@latest info` output here. ⬇ 

npx react-native info

System:
  OS: macOS 15.4
  CPU: (8) arm64 Apple M3
  Memory: 115.11 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.14.0
    path: ~/.nvm/versions/node/v22.14.0/bin/node
  Yarn:
    version: 1.22.22
    path: ~/.nvm/versions/node/v22.14.0/bin/yarn
  npm:
    version: 11.3.0
    path: ~/.nvm/versions/node/v22.14.0/bin/npm
  Watchman:
    version: 2025.05.26.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /Users/custm/.gem/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK:
    API Levels:
      - "33"
      - "34"
      - "35"
    Build Tools:
      - 33.0.1
      - 34.0.0
      - 35.0.0
      - 36.0.0
    System Images:
      - android-33 | Google Play ARM 64 v8a
      - android-34 | Google APIs ARM 64 v8a
      - android-34 | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2024.3 AI-243.24978.46.2431.13208083
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 21.0.6
    path: /usr/bin/javac
  Ruby:
    version: 3.1.4
    path: /Users/neo/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 18.0.0
    wanted: 18.0.0
  react:
    installed: 19.0.0
    wanted: 19.0.0
  react-native:
    installed: 0.79.0
    wanted: 0.79.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Sentry.init()

import * as Sentry from '@sentry/react-native';
import DeviceInfo from 'react-native-device-info';

import config from '@config';

export const utilSentryNavigationIntegration = Sentry.reactNavigationIntegration({
  enableTimeToInitialDisplay: true,
});

export const sentryInitData: Sentry.ReactNativeOptions = {
  dsn: config.sentry_dsn, // https://[email protected]/1234
  environment: config.mode, // development or produnction
  sendDefaultPii: true,
  tracesSampleRate: 1.0,
  // Configure Session Replay
  replaysSessionSampleRate: 0.1,
  replaysOnErrorSampleRate: 1,
  integrations: [
    utilSentryNavigationIntegration,
    Sentry.mobileReplayIntegration(),
    Sentry.feedbackIntegration(),
    Sentry.rewriteFramesIntegration(),
    Sentry.reactNativeTracingIntegration(),
  ],
};


const packageName = DeviceInfo.getBundleId();

const versionNumber = DeviceInfo.getVersion();

const versionCode = DeviceInfo.getBuildNumber();


Sentry.init({
  ...sentryInitData,
  release: `${packageName}@${versionNumber}+${versionCode}`,
  dist: versionCode,
});

export default (app: any) => Sentry.wrap(app);

Steps to Reproduce

Building the iOS app to upload to TestFlight.

Expected Result

The iOS build should not succeed if archiving fails.

Actual Result

▸ Linking my_app
⚠️  ld: ignoring duplicate libraries: '-lc++'
▸ Processing Info.plist
▸ Running script 'Bundle React Native code and images'
▸ Generating 'my_app.app.dSYM'
    Run script build phase '[CP-User] [Hermes] Replace Hermes for the right configuration, if needed' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'hermes-engine' from project 'Pods')
    Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'my_app' from project 'my_app')
    Run script build phase '[CP-User] [RNFB] Core Configuration' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'my_app' from project 'my_app')
    Run script build phase '[CP-User] [RNFB] Crashlytics Configuration' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'my_app' from project 'my_app')
    Run script build phase 'Upload Debug Symbols to Sentry' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'my_app' from project 'my_app')
** ARCHIVE FAILED **


The following build commands failed:
	PhaseScriptExecution Bundle\ React\ Native\ code\ and\ images /Users/my_app/ios/DerivedData/my_app/Build/Intermediates.noindex/ArchiveIntermediates/my_app/IntermediateBuildFilesPath/my_app.build/Release-iphoneos/my_app.build/Script-00DD1BFF1BD5951E006B06BC.sh (in target 'my_app' from project 'my_app')
	Archiving workspace my_app with scheme my_app
(2 failures)
[10:33:45]: Exit status: 65

+-----------------------------------------+
|            Build environment            |
+---------------+-------------------------+
| xcode_path    | /Applications/Xcode.app |
| gym_version   | 2.227.1                 |
| export_method | app-store               |
| sdk           | iPhoneOS18.2.sdk        |
+---------------+-------------------------+

[10:33:45]: ▸ note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'DoubleConversion' from project 'Pods')
[10:33:45]: ▸ note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'AppsFlyerFramework-AppsFlyerLib_Privacy' from project 'Pods')
[10:33:45]: ▸ /Users/my_app/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 12.0 to 18.2.99. (in target 'AppAuth-AppAuthCore_Privacy' from project 'Pods')
[10:33:45]: ▸ note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'AppAuth-AppAuthCore_Privacy' from project 'Pods')
[10:33:45]: ▸ note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'AppAuth' from project 'Pods')
[10:33:45]:
[10:33:45]: ⬆️  Check out the few lines of raw `xcodebuild` output above for potential hints on how to solve this error
[10:33:45]: 📋  For the complete and more detailed error log, check the full log at:
[10:33:45]: 📋  /Users/Library/Logs/gym/my_app-my_app.log
[10:33:45]:
[10:33:45]: Looks like fastlane ran into a build/archive error with your project
[10:33:45]: It's hard to tell what's causing the error, so we wrote some guides on how
[10:33:45]: to troubleshoot build and signing issues: https://docs.fastlane.tools/codesigning/getting-started/
[10:33:45]: Before submitting an issue on GitHub, please follow the guide above and make
[10:33:45]: sure your project is set up correctly.
[10:33:45]: fastlane uses `xcodebuild` commands to generate your binary, you can see the
[10:33:45]: the full commands printed out in yellow in the above log.
[10:33:45]: Make sure to inspect the output above, as usually you'll find more error information there
[10:33:45]:
+---------------------------------------------------------------------------+
|                               Lane Context                                |
+------------------------------------+--------------------------------------+
| ENVIRONMENT                        | beta                                 |
| DEFAULT_PLATFORM                   | ios                                  |
| PLATFORM_NAME                      | ios                                  |
| LANE_NAME                          | ios beta                             |
| SIGH_PROFILE_TYPE                  | app-store                            |
| MATCH_PROVISIONING_PROFILE_MAPPING | {"com.chioboo.my-app"=>"  |
|                                    | match AppStore                       |
|                                    | com.chioboo.my-app"}      |
| VERSION_NUMBER                     | 0.7.14                               |
| BUILD_NUMBER                       | 1                                    |
+------------------------------------+--------------------------------------+
[10:33:45]: Called from Fastfile at line 94
[10:33:45]: ```
[10:33:45]:     92:	    )
[10:33:45]:     93:
[10:33:45]:  => 94:	    build_app(
[10:33:45]:     95:	      workspace: workspace,
[10:33:45]:     96:	      output_directory: "outputs/beta",
[10:33:45]: ```
[10:33:45]: Error building the application - see the log above

+---------------------------------------------+
|              fastlane summary               |
+------+------------------------+-------------+
| Step | Action                 | Time (in s) |
+------+------------------------+-------------+
| 1    | default_platform       | 0           |
| 2    | match                  | 4           |
| 3    | bash                   | 0           |
|      | ./change_app_identifi  |             |
|      | er.sh beta             |             |
| 4    | bash                   | 0           |
|      | ./change_appsflyer_na  |             |
|      | me.sh beta             |             |
| 5    | /usr/libexec/PlistBud  | 0           |
|      | dy -c "Set             |             |
|      | :CFBundleURLTypes:1:C  |             |
|      | FBundleU               |             |
| 6    | update_info_plist      | 0           |
| 7    | increment_version_num  | 0           |
|      | ber                    |             |
| 8    | increment_build_numbe  | 0           |
|      | r                      |             |
| 💥   | build_app              | 225         |
+------+------------------------+-------------+

[10:33:45]: fastlane finished with errors

[!] Error building the application - see the log above
grep -A 20 -B 5 "error\|Error\|ERROR" /Users/Library/Logs/gym/my_app-my_app.log | tail -50
Error: Cannot find module '@sentry/cli/package.json'
Require stack:
- /Users/my_app/ios/[eval]
    at Function._resolveFilename (node:internal/modules/cjs/loader:1225:15)
    at Function.resolve (node:internal/modules/helpers:146:19)
    at [eval]:1:33
    at runScriptInThisContext (node:internal/vm:209:10)
    at node:internal/process/execution:449:12
    at [eval]-wrapper:6:24
    at runScriptInContext (node:internal/process/execution:447:60)
    at evalFunction (node:internal/process/execution:87:30)
    at evalScript (node:internal/process/execution:99:3)
    at node:internal/main/eval_string:74:3 {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/my_app/ios/[eval]'
  ]
}

Node.js v22.14.0
+ SENTRY_CLI_PACKAGE_PATH=
--
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-jsitooling' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-jsinspectortracing' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-jsinspector' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-jsiexecutor' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-jsi' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-jserrorhandler' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-idlecallbacksnativemodule' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-hermes' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-graphics' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-featureflagsnativemodule' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-featureflags' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-domnativemodule' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-defaultsnativemodule' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-debug' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-cxxreact-React-cxxreact_privacy' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-cxxreact' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-RuntimeHermes' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-RuntimeCore' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-RuntimeApple' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-RCTVibration' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-RCTText' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-RCTSettings' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-RCTRuntime' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-RCTNetwork' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-RCTLinking' from project 'Pods')
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'React-RCTImage' from project 'Pods')

Solution)

pnpm add -D @sentry/cli

Metadata

Metadata

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions