react-native-firebase icon indicating copy to clipboard operation
react-native-firebase copied to clipboard

🔥[🐛] NPM Missing optional package from lock file

Open RayanMoarkech opened this issue 5 months ago • 3 comments

Issue

Using the newest NPM version 11.5.2, doing npm install will remove the optional peer dependency @react-native-async-storage/async-storage. Then the pipeline that we have is running an older npm version which is complaining with npm ci:

npm error Missing: @react-native-async-storage/[email protected] from lock file

Any NPM version below 11.5.0 will not remove this optional peer dependency.

I am aware I can downgrade my NPM version, but I think you should be aware of that issue.


Project Files

Not relevant

Javascript

Click To Expand

Not relevant

package.json:

# N/A

firebase.json for react-native-firebase v6:

"@react-native-firebase/analytics": "^22.4.0",
"@react-native-firebase/app": "^22.4.0",

iOS

Click To Expand

Not relevant

ios/Podfile:

  • [ ] I'm not using Pods
  • [x] I'm using Pods and my Podfile looks like: Not relevant
# N/A

AppDelegate.m:

// N/A
Not relevant

Android

Click To Expand

Not relevant

Have you converted to AndroidX?

  • [ ] my application is an AndroidX application?
  • [ ] I am using android/gradle.settings jetifier=true for Android compatibility?
  • [ ] I am using the NPM package jetifier for react-native compatibility? Not relevant

android/build.gradle:

// N/A

Not relevant

android/app/build.gradle:

// N/A

Not relevant

android/settings.gradle:

// N/A

Not relevant

MainApplication.java:

// N/A

Not relevant

AndroidManifest.xml:

<!-- N/A -->

Not relevant


Environment

Click To Expand

react-native info output:

  expo-env-info 1.3.4 environment info:
    System:
      OS: macOS 15.5
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 22.14.0 - /usr/local/bin/node
      Yarn: 1.22.17 - /usr/local/bin/yarn
      npm: 11.4.2 - /usr/local/bin/npm
      Watchman: 2025.03.10.00 - /opt/homebrew/bin/watchman
    Managers:
      CocoaPods: 1.16.2 - /Users/rayanmoarkech/.rvm/gems/ruby-3.4.1/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 24.5, iOS 18.5, macOS 15.5, tvOS 18.5, visionOS 2.5, watchOS 11.5
      Android SDK:
        API Levels: 29, 30, 32, 33, 34, 35, 36
        Build Tools: 29.0.3, 30.0.2, 30.0.3, 32.0.0, 33.0.0, 34.0.0, 35.0.0, 35.0.1, 36.0.0
        System Images: android-29 | Android TV Intel x86 Atom, android-29 | Intel x86 Atom, android-29 | Intel x86 Atom_64, android-29 | Google APIs ARM 64 v8a, android-29 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom_64, android-29 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom_64, android-30 | Google Play ARM 64 v8a, android-33 | Google Play ARM 64 v8a, android-34 | Google APIs ARM 64 v8a
    IDEs:
      Android Studio: 2025.1 AI-251.25410.109.2511.13665796
      Xcode: 16.4/16F6 - /usr/bin/xcodebuild
    npmPackages:
      expo: 53.0.20 => 53.0.20 
      expo-router: ~5.1.4 => 5.1.4 
      expo-updates: ~0.28.17 => 0.28.17 
      react: 19.0.0 => 19.0.0 
      react-dom: 19.0.0 => 19.0.0 
      react-native: 0.79.5 => 0.79.5 
    npmGlobalPackages:
      eas-cli: 16.17.4
      expo-cli: 6.3.10
    Expo Workflow: managed
  • Platform that you're experiencing the issue on:
    • [ ] iOS
    • [ ] Android
    • [ ] iOS but have not tested behavior on Android
    • [ ] Android but have not tested behavior on iOS
    • [ ] Both
  • react-native-firebase version you're using that has this issue:
    • 22.4.0
  • Firebase module(s) you're using that has the issue:
    • N/A
  • Are you using TypeScript?
    • N/A

RayanMoarkech avatar Aug 05 '25 19:08 RayanMoarkech

Same here and the error happens in Expo build :

Running "npm ci --include=dev" in /home/expo/workingdir/build/ directory
npm error code EUSAGE
npm error
npm error `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
npm error
npm error Missing: @react-native-async-storage/[email protected] from lock file
npm error Missing: @react-native-async-storage/[email protected] from lock file
npm error
npm error Clean install a project
npm error
npm error Usage:
npm error npm ci
npm error
npm error Options:
npm error [--install-strategy <hoisted|nested|shallow|linked>] [--legacy-bundling]
npm error [--global-style] [--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
npm error [--include <prod|dev|optional|peer> [--include <prod|dev|optional|peer> ...]]
npm error [--strict-peer-deps] [--foreground-scripts] [--ignore-scripts] [--no-audit]
npm error [--no-bin-links] [--no-fund] [--dry-run]
npm error [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
npm error [-ws|--workspaces] [--include-workspace-root] [--install-links]
npm error
npm error aliases: clean-install, ic, install-clean, isntall-clean
npm error
npm error Run "npm help ci" for more info
npm error A complete log of this run can be found in: /home/expo/.npm/_logs/2025-10-16T16_14_01_918Z-debug-0.log
npm ci --include=dev exited with non-zero code: 1

habaieba avatar Oct 16 '25 16:10 habaieba

I encountered the same problem in version 23.4.1. Everything works fine in version 23.4.0.

mrgarest avatar Oct 31 '25 22:10 mrgarest

Same error on EAS and using

"@react-native-async-storage/async-storage": "2.1.2",
"@react-native-firebase/analytics": "23.5.0",
"@react-native-firebase/app": "23.5.0",

Please fix.

Until that you can fix it with .npmrc file legacy-peer-deps=true settings.

adamita avatar Nov 15 '25 11:11 adamita