question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PhaseScriptExecution, missing script files for `download-realm` in iOS build folder.

See original GitHub issue

Hey Realm Team.

Having quite a bit of trouble getting Realm to install on a newly ejected create-react-native-app. I’ve set up previous versions of Realm into Swift and Obj-C projects in the past quite easily, but not having much luck this time around 😦

I’ve followed the installation guide and linked everything correctly, however it seems that there are several files missing from the referenced iOS build directory, specifically:

  • scripts folder with download-realm.js
  • dependencies.list

These files exist in the node_modules/realm directory, perhaps they aren’t being copied across during the build phase? (Did link perhaps not work correctly?) I’ve tried copying these files manually into the build folder to see if that fixes it, however, that causes further errors, so I thought it would be good to just resolve this problem.

Funnily enough, if I open the project in Xcode and Build & Run, it builds successfully and launches, not sure what to make of that? 🤷‍♂️

Edit: Just did a look through all the build phases for the Realm Projects and couldn’t find any phases that would copy those files to the build folder.

(I’ve also seen #1576, and have tried multiple suggested fixes, however, nothing has worked. I don’t believe it’s an issue with lzma as it can never download the file to being with.)

Goals

Install Realm JS onto a new project and build in iOS successfully

Expected Results

react-native run-ios build succeeds

Actual Results

react-native run-ios build fails:

PhaseScriptExecution Download\ Core /Users/aron/Documents/Apps/ReactNative/<app-name>/ios/build/Build/Intermediates.noindex/RealmJS.build/Debug-iphonesimulator/RealmJS.build/Script-F63FF2C51C12462600B3B8E0.sh

When I attempt to execute that script manually, I see the following output:

v7.10.0 is already installed.
Now using node v7.10.0 (npm v4.2.0)
module.js:472
    throw err;
    ^

Error: Cannot find module '/Users/aron/Documents/Apps/ReactNative/<appname>/ios/build/Build/Intermediates.noindex/RealmJS.build/Debug-iphonesimulator/scripts/download-realm.js'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:427:7)
    at startup (bootstrap_node.js:151:9)
    at bootstrap_node.js:542:3

Directory of /Users/aron/Documents/Apps/ReactNative/<appname>/ios/build/Build/Intermediates.noindex/RealmJS.build/Debug-iphonesimulator/scripts/:

screen shot 2018-04-02 at 10 16 19 am

Steps to Reproduce

  • Create new react native app using create-react-native-app
  • Eject
  • yarn add realm
  • Follow realm setup instructions
  • react-native run-ios

Code Sample

N/A

Version of Realm and Tooling

  • Realm JS SDK Version: 2.3.3
  • Node or React Native: React Native
  • Client OS & Version: OSX 10.13.3
  • Which debugger for React Native: None
  • Attempted Node versions: [ v6.11.1, v7.10.0, v9.10.1]

Thanks for the help! Let me know if you need any more details 👍

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

15reactions
augustocbxcommented, Jul 17, 2018

I fix with

sudo link /usr/local/opt/node@8/bin/node /usr/local/bin/node

2reactions
aburycommented, Apr 2, 2018

After several more hours of hacking away, I finally found a fix! Indeed it did turn out to be a version mismatch of node between nvm and /usr/local/bin/node, even though Xcode reported it was using the right version, something somewhere along the line was getting confused 😕

After matching both versions to 7.10.0, it all worked. 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Run Script | Apple Developer Forums
I can't able to copy the folder files to another folder through runscript. ... PhaseScriptExecution Run\ Script DerivedData/Build/Intermediates/SampleUnity.
Read more >
PhaseScriptExecution error in React Native app - Stack Overflow
I checked pods, node, yarn versions and they are all the same. Opening the .xcworkspace file inside /ios/ folder with Xcode and building...
Read more >
Command PhaseScriptExecution failed with a nonzero exit code
swift file being generated. Looking at the derived data folder it seems like the run-bundled.codegen.sh is missing. I am not sure where to...
Read more >
What “Output Files” in Xcode Build Phases is for - Medium
I'm wondering why we need to declare these files. Shouldn't Xcode be able to read or write these files as we use them...
Read more >
How to fix No such file or directoryCommand ... - YouTube
xcassets: No such file or directoryCommand PhaseScriptExecution failed with a nonzero exit code You can go to runscripts.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found