Trying to use Realm in my React Native app on Windows 10. The output is pasted below. It seems like it's missing the realm pre built stuff for my node version?
Node: 6.9.1
npm: 3.10.8
(React Native: 0.37)
c:\code\ReduxNavigation>npm install realm --save
> [email protected] install c:\code\ReduxNavigation\node_modules\realm
> node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Tried to download(404): https://static.realm.io/node-pre-gyp/realm-v0.15.0-node-v48-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v48 ABI) (falling back to source compile with node-gyp)
c:\code\ReduxNavigation\node_modules\realm>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" clean ) else (node "" clean )
c:\code\ReduxNavigation\node_modules\realm>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" configure --fallback-to-build --module=c:\code\ReduxNavigation\node_modules\realm\compiled\node-v48_win32_x64\realm.node --module_name=realm --module_path=c:\code\ReduxNavigation\node_modules\realm\compiled\node-v48_win32_x64 ) else (node "" configure --fallback-to-build --module=c:\code\ReduxNavigation\node_modules\realm\compiled\node-v48_win32_x64\realm.node --module_name=realm --module_path=c:\code\ReduxNavigation\node_modules\realm\compiled\node-v48_win32_x64 )
Traceback (most recent call last):
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py", line 16, in <module>
sys.exit(gyp.script_main())
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 545, in script_main
return main(sys.argv[1:])
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 538, in main
return gyp_main(args)
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 523, in gyp_main
generator.GenerateOutput(flat_list, targets, data, params)
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 1988, in GenerateOutput
generator_flags))
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 927, in _GenerateProject
return _GenerateMSVSProject(project, options, version, generator_flags)
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 1028, in _GenerateMSVSProject
_AddAccumulatedActionsToMSVS(p, spec, actions_to_add)
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 468, in _AddAccumulatedActionsToMSVS
cmd=command)
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 438, in _AddCustomBuildToolForMSVS
_ConfigFullName(config_name, c_data), tools=[tool])
File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\MSVSProject.py", line 181, in AddFileConfig
raise ValueError('AddFileConfig: file "%s" not in project.' % path)
ValueError: AddFileConfig: file "..\..\binding.gyp" not in project.
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:305:16)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=c:\\code\\ReduxNavigation\\node_modules\\realm\\compiled\\node-v48_win32_x64\\realm.node" "--module_name=realm" "--module_path=c:\\code\\ReduxNavigation\\node_modules\\realm\\compiled\\node-v48_win32_x64"
gyp ERR! cwd c:\code\ReduxNavigation\node_modules\realm
gyp ERR! node -v v6.9.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd configure --fallback-to-build --module=c:\code\ReduxNavigation\node_modules\realm\compiled\node-v48_win32_x64\realm.node --module_name=realm --module_path=c:\code\ReduxNavigation\node_modules\realm\compiled\node-v48_win32_x64' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (c:\code\ReduxNavigation\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:877:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Windows_NT 10.0.10586
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "c:\\code\\ReduxNavigation\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd c:\code\ReduxNavigation\node_modules\realm
node-pre-gyp ERR! node -v v6.9.1
node-pre-gyp ERR! node-pre-gyp -v v0.6.31
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp.cmd configure --fallback-to-build --module=c:\code\ReduxNavigation\node_modules\realm\compiled\node-v48_win32_x64\realm.node --module_name=realm --module_path=c:\code\ReduxNavigation\node_modules\realm\compiled\node-v48_win32_x64' (1)
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "realm" "--save"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the realm package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs realm
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls realm
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! c:\code\ReduxNavigation\npm-debug.log
Getting the same result with Node 6.4.0 and npm 3.10.3.
Same here node 6.9.0 and npm 3.10.9
We are aware of this problem. However, note that Windows is not supported on Node, and building RN apps on Windows currently seems to be a bit problematic as well. I'm looking into it.
@kristiandupont Good to hear that you guys are on it. We haven't had any particular issues while developing RN on the Windows platform, but we are struggling to find a good local storage solution that works both for ios and android, and that supports encryption of data. I must release this project this week though, do you have a tip on what storage solution I could use?
@mattisx I didn't mean to imply that there are general problems, only that we have them (see #633). I might be able to make it work this week but I would hate to be responsible for your project failing, so maybe you should look into other possibilities. I am not capable of advising on that though, sorry.
@kristiandupont Fair enough. I will probably dust off my old mac if I can't find a solution that looks as good as Realm does. Good luck fixing the issues, cheering for you guys.
However, note that Windows is not supported on Node
@kristiandupont May one ask if it is on the roadmap ? To have Realm working with node & electron on Windows is high on our radar, and we are wondering if it is something to be expected in future releases...
@ab335 it is. We want it for the C# sdk as well. However, we need to set up infrastructure for building our core first and implement a few things in realm/realm-object-store before it will work. So we can't give a timeline quite yet.
@kristiandupont About how long does it take to solve the problem
@zhouxin1233 the problem of installing for React Native on Windows is almost solved in #689, so that will be included in the next release that will probably be some time early December. As for using Realm on Windows (via Node or .Net), that's harder to say but we're working on it :-)
@kristiandupont I am waiting too. Thanks
FWIW, I'm seeing the same install issue on a raspberry pi using node6/npm3 (and out of curiosity I also tried node4/npm2 and get the same install error).
node-pre-gyp ERR! Tried to download(404): https://static.realm.io/node-pre-gyp/realm-v0.15.0-node-v46-linux-arm.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v46 ABI) (falling back to source compile with node-gyp)
make: Entering directory '/home/pi/Projects/pzgps/node_modules/realm/build'
ACTION binding_gyp_vendored_realm_target_download_realm /home/pi/Projects/pzgps/node_modules/realm/vendor/core-node
Downloading dependency: core-node 2.1.4
Using cached core-node from TMPDIR
Skipping the sync download because ENABLE_SYNC is false.
TOUCH Release/obj.target/vendored-realm.stamp
TOUCH Release/obj.target/realm-core.stamp
CXX(target) Release/obj.target/object-store/src/object-store/src/collection_notifications.o
So, afaict, it's not just a Windows install issue (meanwhile, it installs as expected on my Macbook running 10.11.6).
The following works for me on Windows 10 (Installing Realm 0.14.3 with [email protected] and React Native 0.39)
Install the older version in the project folder
npm install --save [email protected]
Open node_modules/realm/package.json and remove this line:
"postlink": "node_modules/realm/scripts/rnpm-postlink.js"
Link
react-native link realm
Try your first component
import Realm from 'realm';
export default class TestProject extends Component {
render() {
// Realm.clearTestState(); // Uncomment to drop/recreate database
let realm = new Realm({
schema: [{name: 'Dog', properties: {name: 'string'}}]
});
realm.write(() => {
realm.create('Dog', {name: 'Rex'});
});
return (
<View style={styles.container}>
<Text style={styles.welcome}>
Count of Dogs in Realm: {realm.objects('Dog').length}
</Text>
</View>
);
}
}
DISCLAIMER: I don't recommend avoiding the post link step for production apps (just use a mac), but this at least will enable someone to get Realm working with Windows so they can play around with it until Windows is supported by the Realm install tools.
Getting this issue also.
node-pre-gyp ERR! Tried to download(404): https://static.realm.io/node-pre-gyp/realm-v0.15.0-node-v51-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v51 ABI) (falling back to source compile with node-gyp)
Great! Thanks @kristiandupont Can you push a new release with those changes?
Good job guys!
Awesome job!
Nice
any idea when the changes will be available via npm
Worked for me @EricCarrGH. Thank You.
the solution is to use node < 7. I use 6.9.5 now my project works very well
@MedinaGitHub even rolling back to node 6.9.5 didn't work for me.
any suggestions?
Got the same problem.
OS: linux 16.04
App: react native app (react 16.2, react-native 0.52)
node-pre-gyp info check checked for "/home/james/react_native/app/node_modules/realm/compiled/node-v64_linux_x64/realm.node" (not found)
node-pre-gyp http GET https://static.realm.io/node-pre-gyp/2.12.0/realm-v2.12.0-node-v64-linux-x64.tar.gz
node-pre-gyp http 404 https://static.realm.io/node-pre-gyp/2.12.0/realm-v2.12.0-node-v64-linux-x64.tar.gz
node-pre-gyp ERR! Tried to download(404): https://static.realm.io/node-pre-gyp/2.12.0/realm-v2.12.0-node-v64-linux-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v64 ABI, glibc) (falling back to source compile with node-gyp)
Most helpful comment
The following works for me on Windows 10 (Installing Realm 0.14.3 with [email protected] and React Native 0.39)
Install the older version in the project folder
npm install --save [email protected]Open node_modules/realm/package.json and remove this line:
"postlink": "node_modules/realm/scripts/rnpm-postlink.js"Link
react-native link realmTry your first component
DISCLAIMER: I don't recommend avoiding the post link step for production apps (just use a mac), but this at least will enable someone to get Realm working with Windows so they can play around with it until Windows is supported by the Realm install tools.