2

I have been using the expo cli to create and develop react-native projects. The command I use to generate a new expo react-native project is:

npx expo-cli init demo

I am now trying to replace expo with the react-native cli.

I am on a MacBook Pro 2015 running MacOS 11.1, and I have an iPhone 11 simulator available on my laptop that I've used with my expo apps in the past.

I am following the documentation from the react-native website, found here, to create a sample project.

I already have brew (3.0.4) and node (12.19.0) installed. Node is installed using nvm (0.33.11). I was able to successfully install watchman (4.9.0), XCode, XCode command line tools (12.4), and cocoapods.

I am able to successfully create an application like so:

npx react-native init AwesomeProject

I then start Metro in one terminal window using:

npx react-native start

And then I try to start my application on my iOS simulator using:

npx react-native run-ios

Which starts the build:

info Found Xcode workspace "AwesomeProject.xcworkspace"
info Building (using "xcodebuild -workspace AwesomeProject.xcworkspace -configuration Debug -scheme AwesomeProject -destination id=8E8DFEC9-403B-4486-A5E0-F9A715CB8FFC")
⠴ Building the app.........

Which runs for a few seconds, before a giant log of errors is output. The log is so long I am unable to scroll up to the first line of the error.

When I navigate to the /Users/username/.npm/_logs/... file, the error output starts here:

20 timing npm:load Completed in 14ms
21 timing command:exec Completed in 9746ms
22 verbose stack Error: command failed
22 verbose stack     at ChildProcess.<anonymous> (/Users/ahmedkhan/.nvm/versions/node/v12.19.0/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
22 verbose stack     at ChildProcess.emit (events.js:314:20)
22 verbose stack     at maybeClose (internal/child_process.js:1021:16)
22 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
23 verbose pkgid AwesomeProject@0.0.1
24 verbose cwd /Users/ahmedkhan/Documents/AwesomeProject
25 verbose Darwin 20.2.0
26 verbose argv "/Users/ahmedkhan/.nvm/versions/node/v12.19.0/bin/node" "/Users/ahmedkhan/.nvm/versions/node/v12.19.0/lib/node_modules/npm/bin/npm-cli.js" "exec" "--" "react-native" "run-ios"
27 verbose node v12.19.0
28 verbose npm  v7.5.2
29 error code 1
30 error path /Users/ahmedkhan/Documents/AwesomeProject
31 error command failed
32 error command sh -c react-native "run-ios"
33 verbose exit 1

I haven't been able to find any other similar issues to this online. The only thing I can honestly think of is the fact that I'm using node that was installed through nvm, but I don't understand why that would be a problem.

EDIT I deleted nvm and installed node (15.10.0) using brew and I get the same problem, so it wasn't nvm's fault.

19 verbose npm-session ac762135a77a2325
20 timing npm:load Completed in 20ms
21 timing command:exec Completed in 142599ms
22 verbose stack Error: command failed
22 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
22 verbose stack     at ChildProcess.emit (node:events:378:20)
22 verbose stack     at maybeClose (node:internal/child_process:1067:16)
22 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
23 verbose pkgid AwesomeProject@0.0.1
24 verbose cwd /Users/ahmedkhan/Documents/AwesomeProject
25 verbose Darwin 20.2.0
26 verbose argv "/usr/local/Cellar/node/15.10.0_1/bin/node" "/usr/local/lib/node_modules/npm/bin/npm-cli.js" "exec" "--" "react-native" "run-ios"
27 verbose node v15.10.0
28 verbose npm  v7.5.3
29 error code 1
30 error path /Users/ahmedkhan/Documents/AwesomeProject
31 error command failed
32 error command sh -c react-native "run-ios"
33 verbose exit 1
Ahmed Khan
  • 53
  • 5

0 Answers0