0

Edit

I ended up upgrading the iOS version and running iterm2 using rosetta and the pod install finally worked. I was also using npx pod install when I should of just used cd ios/ && pod install

Original

I am setting up a new laptop and finally got around to building my React native app again and am running into an issue with npx pod install.

npx pod install
Need to install the following packages:
  pod
Ok to proceed? (y) y
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated chokidar@1.7.0: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated mkdirp@0.3.5: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated connect@2.30.2: connect 2.x series is deprecated
npm WARN deprecated coffee-script@1.8.0: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm WARN deprecated core-js@1.2.7: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! code ENOENT
npm ERR! syscall chmod
npm ERR! path /Users/myuser/.npm/_npx/a0ca5f5666585aa2/node_modules/pod/node_modules/pm2/bin/pm2
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, chmod '/Users/myuser/.npm/_npx/a0ca5f5666585aa2/node_modules/pod/node_modules/pm2/bin/pm2'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/myuser/.npm/_logs/2021-11-11T00_43_21_277Z-debug.log

When I go looking in these npx directories they never have anything in the node_modules.

Martin Calvert
  • 1,705
  • 2
  • 11
  • 13
  • What exactly are you trying to do? I don't see `pod install` as a command in a quick skim of the pod docs. – Trott Nov 11 '21 at 01:06
  • Sorry about that @Trott I trimmed the rest of the logs, from the `npx pod install` command. The rest of the log lines were about deprecated packages. – Martin Calvert Nov 11 '21 at 01:29

1 Answers1

4

Looking at the pod package.json file, it appears to have a dependency on pm2 being installed in the module's own node_modules directory but that's not how npx does things. So that's why you're getting ENOENT (which is basically "path not found") for the pm2 module as your error message.

The easiest solution is probably to not use npx with pod but to instead do as the README instructs and install pod as a global package with npm install -g pod. Then run pod install instead of npx pod install.

Trott
  • 66,479
  • 23
  • 173
  • 212
  • Thanks for this. I had the command wrong so ultimately it was a combo of old iOS versions and me using the wrong command that ran me into this corner. Sorry for wasting your time. – Martin Calvert Nov 17 '21 at 02:17