re-start
re-start copied to clipboard
Babel-Jest and Jest Versions Incompatible w/ React-Scripts Dependency-Requirements
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
- template name :re-start
- template version : 0.0.1
- react-native version: 0.59.5
- OS : Linux
- Platform causing error: web (didn't try others)
Step 3: Describe the problem (try to include screenshots):
First error - Could not find [email protected].. Latest version of react-native-windows is 0.57.1, try switching to [email protected].. 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,
- I changed the react-scripts to the latest minor version within the major-version (v2.1.8).
- I removed from defDependencies "babel-jest" and "jest" ( so react-scripts compatible versions would be installed - v23.6.0 vs the v24.7.1 specified )
Then:
- deleted the node_modules folder
- ran yarn
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.
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.
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.