PhaseScriptExecution, missing script files for `download-realm` in iOS build folder.
See original GitHub issueHey 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/
:
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:
- Created 5 years ago
- Comments:6
Top GitHub Comments
I fix with
sudo link /usr/local/opt/node@8/bin/node /usr/local/bin/node
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. 👍