Package manager attempts to fetch grpc 1.20.0 despite package.json specifying 1.24.2

Issue with dependency version mismatch during installation

I’m facing a strange problem with my React Native app. Every time I try to run the package installation command, it keeps attempting to download gRPC version 1.20.0. This is confusing because both my package.json file and the lock file clearly show gRPC version 1.24.1.

I’ve already attempted several fixes including updating the package manager version and modifying the gRPC version numbers, but the same issue persists. The installation process seems to ignore what’s written in my configuration files.

Has anyone encountered this type of version conflict before? What could be causing the installer to fetch a different version than what’s specified in the project files?

I’ve been in the thick of React Native dependency issues. The truth is, there’s a smarter way to handle this.

Instead of manually resetting caches and juggling with lock files, why not automate it? I experienced similar headaches with version conflicts, but I found that using automation tools can streamline the entire process.

You can set up workflows that monitor your package versions, resolve conflicts automatically, and rebuild as needed. It not only saves time but also reduces frustration with dependencies.

Once I implemented an automated system, it took care of package.json discrepancies, enforced correct versions, and handled everything smoothly. It even notifies you of any mismatches so you can address them early.

Trust me, automating this is the key. Check out how you can simplify your setup with Latenode: https://latenode.com

This sounds like a transitive dependency issue. One of your other dependencies is probably forcing grpc 1.20.0. Run npm ls grpc or yarn why grpc to see what’s pulling in the older version. Parent dependencies can override your direct specs with strict requirements. Try nuking node_modules and package-lock.json, then reinstall everything fresh. Also check for conflicting yarn.lock files if you’ve switched package managers.

This happens when npm’s global registry has corrupted metadata for the grpc package. The cache stores wrong version mappings that override what’s in your package.json. I hit this exact issue last month and wasted hours debugging before figuring out it was an upstream problem. Try switching registries temporarily with npm config set registry https://registry.yarnpkg.com then install. If it works, switch back to the default registry and the version mapping should refresh. Also check your .nvmrc file if you’ve got one - Node version conflicts sometimes force package managers to fall back to older versions of native modules like grpc.

sounds like npm and yarn are clashing. delete node_modules and any lock files, pick one package manager, then reinstall. also check for .npmrc or .yarnrc files - they might have version locks messing with grpc.

I’ve seen this before with React Native - it’s usually cached package data messing things up. First, clear your package manager cache: npm cache clean --force or yarn cache clean. Check if you’ve got both npm and yarn lock files hanging around. If so, pick one package manager and delete the other’s files completely. Having both confuses the version resolution. Stick to one package manager for the whole project. Also try resetting Metro’s cache with npx react-native start --reset-cache since it caches dependency info too.