Unexpected error using create-react-native-app: - reactjs

Attempting to use create-react-native-app and falling at the first hurdle here.
I think the problem is when Yarn attempts to install dependencies:
yarn install v0.27.5
[1/4] Resolving packages...
warning react-native > connect#2.30.2: connect 2.x series is deprecated
error An unexpected error occurred: "https://raw.githubusercontent.com/expo/node-websql/e364fa65146a9e2157a19e5c719e7702c2b6b87a/package.json: connect ETIMEDOUT 90.207.238.183:443".
info If you think this is a bug, please open a bug report with the information provided in "D:\\users\\jamie\\WebstormProjects\\hang\\hang-app\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Failed to install
What's odd is that I ran create-react-native-app on this machine last week to test it out and everything was fine.
Does anyone have any idea about what might be going on here?

The error message says towards the end of the 4th line: connect ETIMEDOUT, which I assume means that Yarn timed out while downloaded that package.json file.
I just tried pasting the URL in my browser and it loaded, so if you try again it might just work!

Related

npm error while installing package in reactjs

When I try to install any npm package, I get the following error. And the installation gets stuck.
I've pasted the error below
Error msg:
This version of npm is compatible with lockfileVersion#1, but package-lock.json was generated for lockfileVersion#2. I'll try to do my best with it!
Help me to solve this problem. Thanks in Advance.
The error message you mentioned is due to the fact that you are running an older version of npm. You are probably on v5 or v6 while your package-lock.json was generated with v7+.
However, that message is usually a warning, and not a final error. Would double check to see if you have other error messages as well.
More details for package-lock.json versions at: https://docs.npmjs.com/cli/v8/configuring-npm/package-lock-json#lockfileversion

Why am I getting a "Cannot find module './cli-engine'" error and how can I fix it?

I'm new to programming, so please be gentle.
When I use 'npm start' to view my react app in local host it won't compile. I get an error message, 'Cannot find module './cli-engine'. That was not the case until today.
I suppose this file was in node_modules until recently? How can I restore my development environment to normal without breaking anything?
Here's the full error message:
Cannot find module './cli-engine'
Require stack:
- /Users/louysgackstetter/Desktop/Portfolio/Dominion/dominion/node_modules/react-scripts/node_modules/eslint/lib/api.js
- /Users/louysgackstetter/Desktop/Portfolio/Dominion/dominion/node_modules/eslint-webpack-plugin/dist/getESLint.js
- /Users/louysgackstetter/Desktop/Portfolio/Dominion/dominion/node_modules/eslint-webpack-plugin/dist/linter.js
- /Users/louysgackstetter/Desktop/Portfolio/Dominion/dominion/node_modules/eslint-webpack-plugin/dist/index.js
- /Users/louysgackstetter/Desktop/Portfolio/Dominion/dominion/node_modules/eslint-webpack-plugin/dist/cjs.js
- /Users/louysgackstetter/Desktop/Portfolio/Dominion/dominion/node_modules/react-scripts/config/webpack.config.js
- /Users/louysgackstetter/Desktop/Portfolio/Dominion/dominion/node_modules/react-scripts/scripts/start.js
UPDATE: npm install did not fix the issue. Or rather, it did, I no longer got the error described above, but I got a different "Cannot find module" error instead. Ultimately I created a completely new react-redux app using the create-react-app command and moved my source code over. Took me 10 minutes, solved the problem like a charm.
You can try npm install, and see if that resolves the problem.
Here is explained everything you need to know about it:
What's the difference between dependencies, devDependencies and peerDependencies in npm package.json file?

Yarn start fails with Unexpected identifier without details

I am trying to start up a react app. After cloning the code from github, running yarn install I ran yarn start and got the following error:
yarn run v1.22.10
$ cross-env HTTPS=true react-scripts start
Unexpected identifier
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The authors of the app don't know what might be wrong (it's working for them). I tried creating another app with create react app and that started up fine for me. I am not sure where to start looking as there is no indication as to where the "unexpected identifier" might be located or what it might be. Any ideas on what I might want to check or try? I am on MacOS Catalina.
I figured it out eventually. I tried running build and it failed on syntax error in one of the .js files (a missing comma). Once that was fixed the start ran too. If the start command returned the same informative error the build did it would have saved me hours :)

React Auth0 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

I have been following along with this introductory Auth0 React app build-along (link below) and have been running into the same error over and over and can't seem to find any solution. I made this yesterday and it worked 100% until it crashed and gave me this the error message below. I restarted the app many times, rebooted my computer, but nothing fixed it. To check my sanity, I started this project from scratch again but the error message still occurred.
I went to the path where the error was located but couldn't find anything that stood out to me. The problem seems to have started as soon as I installed the npm SDK npm install --save #auth0/auth0-spa-js because before I installed that, the app was working just fine and text was displaying as it should. As soon as you install the SDK, the text disappears.
I even deleted the entire auth0 package in the node_modules folder just to see what would happen and the same error message occurred. Does anyone have some insight into this problem? I am losing my mind and any help would be greatly appreciated!
Code-along link: https://auth0.com/blog/authenticating-your-first-react-app/
Error message: Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
Error location: ./node_modules/#auth0/auth0-spa-js/dist/auth0-spa-js.production.esm.js
SDK: npm install --save #auth0/auth0-spa-js (version 1.8.0)

React Native Error - Unable to resolve "./withSafeArea" from "node_modules\react-native-safe-area-view\index.js"

I've just updated my React native version to 0.57 from 0.55.
I'm getting bunch of errors starting from Barbel, fixing errors one by one.
Now I'm encountering
"Unable to resolve "./withSafeArea" from
"node_modules\react-native-safe-area-view\index.js"
Error, and that's all information the console gives.
I tried googling it, seems like I'm the first one encountering this error.
What is the error here?
So far I've tried:
delete node_modules folder and do npm install again.
npm install react-native-safe-area-view.
Both no luck :(

Resources