Error while trying to start react application - node.js

[Error while trying to start myfirstreact using npm start]
Hi All,
I am new to react. I am trying to start myfirstreact using npm start, I am getting an error which is giving me a path to debug but, I am not able to understand the error.
Can anyone help me to fix this issue?

Are you using Create-react-app? In the words of https://reactjs.org/docs/create-a-new-react-app.html (and they should know):
Create React App is a comfortable environment for learning React, and is the best way to start building a new single-page application in React.
It's one line of code to install it, and one line of code to create a working app that updates automatically at every save. And the code is more up to date than a lot of examples and tutorials you can find (uses functional programming, for example).

Related

Problem in set up environment in VScode for React Native using Expo Cli

I am a newbie in React Native and I am trying to set up the environment for it in VScode using Expo Cli. Even though I follow all the steps in Youtube, I still can't make it. I have installed Node.js and extension of React Native. I have opened the port for the Metro Bundler and Web but I don't know why I can't open them.
Here are pictures of my screen. This is my first post, so I'm not allowed to post pictures but links. Sorry for the inconvenience.
1st
2nd
I have no clue how to fix it so I try to search for the problem, but nothing has improved.

Create React App command does not make react components

My question is pretty easy but could not find what is the error.
I try to create new project on React but when I try, I can see only packetJson files but components are not created.
I have no error while installing as well.
How can I fix it?

Convert existing Angular project to Universal, encounter 'referenceerror: navigator is not defined'

I recently faced the task of converting a fairly mature angular project to SSR because I had overestimated the search power of SEO in angular projects. I'm not familiar with node, my angular project is on an apache server and uses php(slim) as the backend api, however, when I started trying to use "most of the tutorials", i.e., the first step, introducing nguniversal/express-engine into the project, it went well, npm did not report any errors.
Then I tried to run npm run build:ssr and it also worked fine. The problem is that when I run npm run serve:ssr, it ends up throwing a "ReferenceError: navigator is not defined" error...
Earlier, I built a completely clean angular project for testing, from build:ssr to run serve:ssr. Even I specified node xxxx/xxxx/main.js directly, no problem, which is obvious, because the angular project for testing is absolutely clean.
However, this does not work on my current "existing angular project". Yes, I fully understand that SSR doesn't allow for navigator or most so-called DOM manipulation, and although I'm not familiar with angular universal yet, I've previewed it and I know that's not possible, but here's the biggest problem :
In this existing angular project, there is no any navigator operations, not even a single line of code
In fact, main.js is also generated automatically, I can't stop it at all, I don't understand why there is "navigator" written in main.js?
I've checked many so-called solutions, including writing something in server.ts, but nothing helps, how can I continue? This is really quite desperate!
Big thank any help!

React create issue

I've started a course to learn React and I'm having
trouble in developmental setup.
In the previous course, I used browser-sync and in this course the teacher used lite-server, so I installed that. But now, on creating react app, I'm having this error and I can't understand, please help.
I'm new to the whole npm, node.js environment.
Screenshot of Error

Is it possible to work on react using JSX, without a node server and using create-react-app

I'm in a big trouble, I'm a really a noob on React and in the company I work on I propose to code a project that was on pure Javascript to update it to ReactJS,
In this project I can't use a node server And I have been coding React without JSX as shown on this page:
https://facebook.github.io/react/docs/react-without-jsx.html
it's working... but as soon as the project gets more complicated, then gets more complicated to code...
I though I have found a solution to work on JSX without a Node server, that is to code with create-react-app:
https://github.com/facebookincubator/create-react-app
I can code on JSX and then run the command "npm run build" and it generates all the React code in the build folder, and then I tried to run build/index.html, but it doesn't load anything, any idea If what I'm trying to do is it possible?
Once you get things working the right way, I highly recommend you use .jsx. You can hook a frontend to any backend you want. Don't you have an existing index.html file that you can import your React entry file into?
create-react-app has its own way of doing things. If you're updating an existing codebase, you should probably be starting from scratch.
You need a server to host your dist/index.html site. This requires you to build a simple server with either node or some other back end programming language. I believe the reason it works whenever you use create-react-app it is because when you npm start create-react-app runs a simple server to host your application. Why can't you use a node server?

Resources