Open luposlip opened 6 years ago
Looks like this might be your issue, and installing watchman with brew instead of npm might fix it: https://github.com/react-community/create-react-native-app/issues/281
Will try that, and revert. Thanks!
Well, the error is nicer now, but seem to persist:
Looking for JS files in
/Users/user/map-todo-demo
React packager ready.
Loading dependency graph, done.
Bundling `index.ios.js` [development, non-minified, hmr disabled] 0.0% (0/1), failed.
error: bundling failed: "Cannot find entry file index.ios.js in any of the roots: [\"/Users/user/map-todo-demo\"]"
If you have a newer version of React Native, it wants an index.js
instead of an index.ios.js
... you can either copy the ios version, or change the bundle location in AppDelegate.m
(I think). I just ran into this as well, was going to put together a PR for re-natal to make that change.
Thanks again, I'll try that, and get back to you :)
OK. I uninstalled node completely, and reinstalled it with brew install node
. Then I installed react-native
again.
I forced the installation to 0.49.5
by npm install -g react-native@0.49.5
.
It still gave me an error.
Then I changed from index.ios
to index
in AppDelegate.m
. The result is the same error, except the missing file is now index.js
:
React packager ready.
Loading dependency graph, done.
Bundling `index.js` [development, non-minified] 0.0% (0/1), failed.
error: bundling failed: NotFoundError: Cannot find entry file index.js in any of the roots: ["/Users/user/map-todo-demo"]
at DependencyGraph._getAbsolutePath (/Users/user/map-todo-demo/node_modules/metro-bundler/src/node-haste/DependencyGraph.js:305:11)
at DependencyGraph.getDependencies (/Users/user/map-todo-demo/node_modules/metro-bundler/src/node-haste/DependencyGraph.js:283:4236)
at Resolver.getDependencies (/Users/user/map-todo-demo/node_modules/metro-bundler/src/Resolver/index.js:129:5)
at /Users/user/map-todo-demo/node_modules/metro-bundler/src/Bundler/index.js:642:39
at Generator.next (<anonymous>)
at step (/Users/user/map-todo-demo/node_modules/metro-bundler/src/Bundler/index.js:13:1336)
at /Users/user/map-todo-demo/node_modules/metro-bundler/src/Bundler/index.js:13:1496
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
As a RN noob I know that the issue is probably not with your code but my setup. And if you can point me in the right direction I highly appreciate it! :)
Tried to delete the folder, re-clone it, lein figwheel ios
, and then force to either react-native version 0.44.0
or 0.49.5
with npm install --save react-native@VERSION
.
In particular for version 0.49.5
:
npm install --save react-native@0.49.5
npm install --save react@16.0.0-beta.5 react-dom@16.0.0-beta.5
react-native run-ios
With both versions it doesn't build:
ld: library not found for -lAirMaps
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **
Ah, I think you need to run react-native link
(to link the native maps library in there); I'll add that to the README then.
I get 2 errors when I run react-native link
:
Error: Cannot find module '/Users/user/enterlab/map-todo-demo/node_modules/babel-plugin-transform-es2015-block-scoping/package.json'
Error: Cannot find module '/Users/user/map-todo-demo/node_modules/react-native-maps/package.json'
Seems to me React Native is very fragile - I have only been able to run a single sample app I've found on github. And then of course create and run my own empty app :(
You can always try rm -rf node_modules
, or if it's still giving you trouble with that, use yarn
which some people have had a little better luck with. Unfortunately you're right; NPM is kind of a disaster, and everything built on it is inherently rickety.
Sorry for not updating this for a while. I've been starting my own POC from scratch. Will revert to this issue when I'm longer in my journey!
Hi Joshua!
First of all, thanks for sharing your project and presentation! I've tried to run the app, but keep getting the following error with
react-native-cli
2.0.1 andreact-native
0.47.1:I'm a complete noob to React Native - can you point me in the direction of a way to solve this?
Thanks, Henrik