react-everywhere / re-start

react-native template to target multiple platforms :globe_with_meridians: :iphone: :computer: with single codebase.
https://medium.com/@amoghbanta/write-once-use-everywhere-with-react-native-d6e575efe58e#.nfl50gwfg
MIT License
1.3k stars 85 forks source link

Babel-Jest and Jest Versions Incompatible w/ React-Scripts Dependency-Requirements #78

Open ZiaMM opened 5 years ago

ZiaMM commented 5 years ago

Step 1: Are you in the right place?

I think so, as it occurs when following the read-me instructions and is the result of node-package versions which specified in the package.json file, but incompatible.

Step 2: Describe your environment

Step 3: Describe the problem (try to include screenshots):

First error - Could not find react-native-windows@0.59.. Latest version of react-native-windows is 0.57.1, try switching to react-native@0.57.. I did not attempt to troubleshoot/fix this, as I am only interested in web, iOS, Android. After commenting out "enableWindows();" in ./finishInstall.js this script ran OK.

Then ... Errors on attempting to start - first citing incompatible versions of babel-jest / jest, then ELIFECYCLE error crash.

Steps to reproduce:

Following the read-me instructions

Expected Results:

Installs & Starts OK

How I fixed it: (maybe?)

In the package.json,

Then:

Was able to run "npm run web" and get the default-page to load OK. I am unsure of any new problems this may have created, if functionality in v24 of babel-jest and jest are needed for functionality beyond the demo-page.

Note there is no src/screens/EntryScreen or src/components/TopLevelComponent.js in "re-start" - so the demo screen shows "re-route" instead. It might be a good idea to include those, if only just so they would overwrite the "re-route" ones, so a new-user knows they didn't miss installing the last template (re-start) over the others.

piranna commented 5 years ago

We currently don't have tests to check version updates break things, they would be nice. Also, we are thinking to move from using templates, to convert finish-install.js in an independent CLI to just add missing platforms to current projects, that would be more flexible. Main problem with that would be web platform, but if react-native-dom gets more mature, it would be easy.

brandongroce commented 5 years ago

First error related to this: https://github.com/Microsoft/react-native-windows/issues/2003

finishInstall.js fails due to expectation of App.windows.js after react-native windows fails. Would it be better to if (existsSync('App.windows.js')) here so the install doesn't bomb out (given react-native-windows stability) or wrap it in a try catch? Or is the expectation that you would want this to fail? I can PR if this is of any interest.