how to run an already ready app in react js with npm - reactjs

npx create-react-app my-app
cd my-app
npm start
This is how I created a react app. But if I get an already ready app in react how will I run it?

Inside the project directory run: npm install, this will install all of your project dependencies, and after that, you can start the app with the npm start command.

Open the Terminal,
Go to Project Directory
Use this command
npm install
It will install all the dependencies that are necessary to run this project.
Now run the development server
npm start

Development:
npm install
npm start
Production*:
./build/index.html
*if build folder doesn't exist then execute:
npm run build

Related

create-react-app not working. Getting error "Module not found"

This is what I'm getting
I am not able to create a project using create-react-app, I get the error "Module not found".
Node version is 17.0.1 and Npm version is 8.1.1
I have reinstalled nodejs 3 times now and have tried different commands like
npm install create-react-app -g
npm cache clean --force
P.S - I have updated the nodejs to 17.0.1 as the picture version shows 16.13.0
You can try with npx create-react-app my-app.
Visit for more details create-react-app
To create a new app, you may choose one of the following methods:
npx
npx create-react-app my-app
npm
npm init react-app my-app
npm init <initializer> is available in npm 6+
Yarn
yarn create react-app my-app
yarn create is available in Yarn 0.25+
So after almost 3-4 hours of trying different things, it has worked.
I dont know which particular thing would have helped it to work but following are the things I tried -
Delete npm and npm cache folder.
Reinstall the nodejs (LTS version).
Create the app in another folder.
Used power shell instead of CMD.
npm fix
npm fix --force

How to make create-react-app use npm instead of yarn?

I kind of rushed into creating a React app based on a tutorial that used yarn. Now I'm going to re-create the app from scratch because I'm not satisfied with the reactstrap library, and I'd like to switch to react-bootstrap.
I've re-installed node. However, when I run create-react-app, it says to use "yarn" instead of "npm" as follows:
yarn start
Starts the development server.
yarn build
Bundles the app into static files for production.
yarn test
Starts the test runner.
yarn eject
Removes this tool and copies build dependencies, configuration files
and scripts into the app directory. If you do this, you can’t go back!
We suggest that you begin by typing:
cd react-test
yarn start
I'd like to use npm because it seems like it's more widely used and there are more examples based on it. Am I stuck with yarn, or can I go ahead and use npm?
You can either
1) Remove yarn.lock, and running npm i,
or
2) Run create-react-app app --use-npm
1 ⇢ If you have installed create-react-app then use:
create-react-app --use-npm
2 ⇢ If you are using npx command then use:
npx create-react-app --use-npm
3 ⇢ For existing yarn app, remove the yarn.lock file and run:
npm i
or
npm install
Install create-react-app npm i -g create-react-app --use-npm
Go to desired path using cd command
Add --use-npm create-react-app my-app-name --use-npm
This command will create a folder with the name that you mentioned inside your current path . This folder consists all necessary configuration files needed for a starter code for react application
# Run this to create-react-app using npm
npx create-react-app my-app
# Or run this to create-react-app using yarn
yarn create react-app my-app
I dont know if this helps. But I was having the same problem and did this
npx expo-cli init --npm
and it installed with npm
hope this helps you or someone in the future
For latest versions, the flag is changed to --npm
So if you want to use npm then use it like
npx react-native init YourProject --npm

npm error when install react project in create-react-app

Hi thanks for reading this topic
I work with react I nowadays trying to learn ReactJS when install react new app show an error for uninstall react new project
what is my problem
in Command Terminal
npm ERR! Unexpected end of JSON input while parsing near
'...9.1","tslint-config
-p'
npm ERR! A complete log of this run can be found in: npm ERR!
C:\Users\john\AppData\Roaming\npm-cache_logs\2019-12-26T01_36_25_1
39Z-debug.log npm install --save #testing-library/react#^9.3.2
#testing-library/jest-dom#^4.2 .4 #testing-library/user-event#^7.1.2
failed
I think it's version problem.
If you've previously installed create-react-app globally via npm install -g create-react-app, we recommend you uninstall the package using npm uninstall -g create-react-app to ensure that npx always uses the latest version
Quick Start
npx create-react-app my-app
cd my-app
npm start
For more clarification check this reactjs
I faced the same problem quite a few times.
Then used following commands, it worked for me
npm init
npm cache clean force
npx create-react-app my-app
cd my-app
npm start

Error while installing create-react-app globally using npm

I am unable to install react js using NPM. I am getting following error.
Your environment has been set up for using Node.js 12.3.1 (ia32) and npm.
C:\Users\User>npm install create-react-app -g
npm ERR! code UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR! errno UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR! request to https://registry.npmjs.org/create-react-app failed, reason:
unable to verify the first certificate
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Roaming\npm-cache_logs\2019-12-14T05_54_58_7
16Z-debug.log
I am form India and I am not using any corporate firewall or VPN.
hey can you try using npx create-react-app ${your project name}
I ran the following command in the command line and worked for me:
npm config set strict-ssl false
Although it's not a great idea.
run this command to turn it on again:
npm config set strict-ssl true
Download Node.js archive
Download latest version of Node.js installable archive file from Node.js Downloads.
After successfully installing NodeJS, we can start installing React upon it using npm. You can install ReactJS in two ways.
- Using webpack and babel.
- Using the create-react-app command.
But I am telling you about Using the create-react-app command:
- Instead of using webpack and babel you can install ReactJS more simply by installing create-react-app.
Browse through the desktop and install the Create React App using command prompt as shown below:
Step 1: go to your specific directory and run below commands inside the folder like as below:
Step 2: d:\reactproject\>npx create-react-app my-app
Step 3: cd my-app
Step 4: npm start
Check if your date is right.
If it's not run this and try again:
sudo date --set="2015-09-30 10:05:59.990"

use create-react-app and don't have any folder

I want to create a new app with react js and when I create an app, I don't have any folder (src, public) and when I start project get this error
npm ERR! missing script: start
npm ERR! A complete log of this run can be found
follow this steps
npm uninstall -g create-react-app
npm cache clean --force
npm i create-react-app -g
npx create-react-app my-app

Resources