npm start not working after create-react-app - reactjs

I am trying to create a react app with the below steps:
npm install -g create-react-app
create-react-app my-app
cd my-app
npm start
And I get this error:
In error have suggestion to remove webpack dependency but i cant do that because in file package.json dun have that. Here my package.json
For additional information:
i am using windows 10
npm 6.4.1
create-react-app version 2.0.3
node v8.12.0

Just do following steps:
- delete package-lock.json.
- delete node_modules.
- npm install.
Or
Just try steps mentioned in the error log and you will be fine .

Do step number 6 and delete that babel loader or webpack folder and you will be good afterwards. Chances are you have an outdated web pack or babel that you installed in a previous project.

I just had this very issue, and turns out to be something simple
The part of the log that says about there being a
"a different version of webpack was detected higher up in the tree"
looks to be the same case for you. I think you may have ran npm install at some point under D:\bolehDiHapus and so have node_modules installed further up the tree that you meant.
I simply changed the name of D:\bolehDiHapus\node_modules (probably best to just delete it) and hey presto npm start works.

I had this same issue, first it started saying we found the wrong version farther up in the tree, and then i had to delete webpack up there, and then i had install their "required version" even if it is lower than latest.
npm install webpack#version --save
in your case: npm install --save webpack#4.19.1

Related

npm start command not found in create-react-app -- how to add to package.json? [duplicate]

I cloned a react application onto my system and ran following commands
npm install -g create-react-app
npm install --save react react-dom
After that i ran
npm start
But it threw the above mentioned error, It is working fine on my other system from which i pushed it on github. But it is not working on any other system after cloning whether windows or mac.
Check if node_modules directory exists. After a fresh clone, there will very likely be no node_modules (since these are .gitignore'd).
Solution
run npm install (or yarn) to ensure all deps are downloaded.
Alternative Solution
If node_modules exists, remove it with rm -rf node_modules and then run npm install (or yarn).
Tried all of the above and nothing worked so I used npm i react-scripts and it worked
I had similar issue. In my case it helped to have Yarn installed and first execute the command
yarn
and then execute the command
yarn start
That could work for you too if the project that you cloned have the yarn.lock file. Hope it helps!
In package.json, I changed
"start": "react-scripts start"
to
"start": "NODE_ENV=production node_modules/react-scripts/bin/react-scripts.js start"
I hope this solves the problem for some people. Although the other solutions above seem not to work for me.
you should not install react-scripts globally, for me this fixed the problem:
npm install --save react react-dom react-scripts
if this still dont work :
update to latest npm version : npm install -g npm#latest
delete node_modules directory
reinstall all dependencies : npm install
https://github.com/facebookincubator/create-react-app
npm install -g create-react-app
create-react-app my-app
cd my-app/
npm start
You install the create-react-app package globally.
After that you run it and create a project called my-app.
Enter your project folder and then run npm start. If that doesn't work try running npm install and then npm start. If that doesn't work as well, try updating your node version and/or npm.
I had this problem for ages and I eventually found my solution by sheer chance.
Turns out, you can't have spaces or wacky characters in any folder names.
e.g.
~/projects/tutorial/ReactJS/JavaScript Framework: ReactJS/app-name
won't work because JavaScript Framework: ReactJS contains spaces.
In general, it's probably not great practice to be using spaces in folder/file names anyway but I hope this saves someone at least 4 hours of trial and error.
Also, any non-alphanumeric characters should be avoided.
This error occurs when you Install package with npm install instead of yarn install or vice-versa.
using npm i --legacy-peer-deps worked for me.
I do not know specifically which operation out of the following it performed:
Installing the peer dependencies' latest stable version.
Installing the peer dependencies' version which the core dependy you are installing uses.
But I think it performs the latter operation. Feel free to let me know if I'm wrong ^-^
npm install --save react react-dom react-scripts
Above command worked for me.
This boggles me time to time when I have a fresh start with create-react-app, please make sure your NODE_ENV variable is set to development not production, as devDependencies in your package.json will not be installed by npm install.
If you are having this issue in a Docker container just make sure that node_modules are not added in the .dockerignore file.
I had the same issue sh1 : react scripts not found. For me this was the solution
Just ran into this problem after installing material-ui.
Solved it by simply running npm install again.
Just doing an Yarn install solved the problem for me
Deleting package-lock.json and node_modules then npm install worked for me.
If none of the other answers work properly (after updating the npm etc). I would strongly recommend you to install the project on your desktop.
create-react-app project_name
The solution that worked for me is below. Try creating React app with this command.
create-react-app react-app --scripts-version 1.1.5
this worked for me.
if you're using yarn:
delete yarn.lock
run yarn
and then yarn start
if you're using npm:
delete package-lock.json
run npm install
and then npm start
If anyone still have this problem after trying these solutions: check your project path as node has some issues working with spaced dir names. I changed all directories names that had spaces in their names and it worked perfectly.
solution idea taken from: https://npm.community/t/react-scripts-not-found/8574
i am using yarn BTW
You shoundt use neither SPACES neither some Special Caracters in you path, like for example using "&". I my case I was using this path: "D:\P&D\mern" and because of this "&" I lost 50 minutes trying to solve the problem! :/
Living and Learning!
If you have tried everything and nothing solved it, try to rename the directories name. react will not start if the folder's name contains uppercase letters.
After spending too much time trying all the solutions above, I can say for sure:
If you ran into this issue, check your path. If the path contains any special character or spaces just rename it and make sure that the new path doesn't have any spaces or special character. Then run it again .
delete node_modules
run npm install
after that run npm start
if above does't work
delete node_modules
delete package-lock.json
run npm install
and then npm start
if above solutions does not fixed your problem, try the following this worked for me:
if you want to start on another port or PORT command not found error then do the following steps:
open package.json file
inside script replace the start command with below
"start": "set PORT=3006 && react-scripts start"
To change the port of your app, you can also create a new file name .env in the root directory of the project and write in it PORT=3006 (then save the file). Now run your app using npm start.
I just randomly experienced this "react-scripts: command not found" error after issuing a react-scripts build request, which was previously working just fine.
A simple reboot of my system corrected the issue.
if anyone is willing to use npm only, then run this npm i react-native-scripts --save, then npm start or whatever the command you use
solution 1:
delete the package-lock.json file and then type -> npm install
solution 2:
/Users/piyushbajpai/.npm/_logs/2019-03-11T11_53_27_970Z-debug.log
like this is my debug path --> so this you will find in the console -> press on command and click on the link, you will find error line;
like this:
verbose stack Error: nest_form#0.1.0 start: react-scripts start
solution 3:
delete the node_module and npm i with fresh way.
solution 4:
go to node_module and delete jses folder and delete it, then do npm i and again start with npm start
I had issues with latest version of yarn 1.15.1-1
I've fixed it by downgrading to lower version sudo apt-get install yarn=1.12.3-1
I ran into this error after renaming the directory with the #/ symbol on macOS to match the name of my NPM package namespace.
When the NPM command looked for installed packages in my local node_modules, it couldn't find it due to the way macOS was rewriting the directory path. After renaming the directory without #/ I was up and running again.
Just You have to restore packages to solve this issue,
So just run command :
npm install or yarn install
I tried every answer but cleaning my npm cache worked..
steps:
Clean cache =====> npm cache clean force.
reinstall create-react-app =====> npm install create-react-app.
npm install.
npm start !!!

Error while npm run build? eslint package error

npm start
pushercoins#0.1.0 start
react-scripts start
There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.
The react-scripts package provided by Create React App requires a dependency:
"eslint": "^7.11.0"
Don't try to install it manually: your package manager does it automatically.
However, a different version of eslint was detected higher up in the tree:
/Users/sujit_jaiwaliya/node_modules/eslint (version: 6.8.0)
SOLUTION:
This worked for me I hope it does the same to you guys:
I Unistall eslint version 6.8.0 :
npm uninstall eslint#6.8.0
Then I install eslint#7.11.0:
npm i eslint#7.11.0
Then i run fix audit:
npm audit fix --force
Then i changed the DIR file by adding a .env file with this code in it :
ESLINT_NO_DEV_ERRORS=true
This issue has been fixed in the react-scipts:"4.0.3" but, the eslint errors present in the project are not converted to warnings by default. You have to create an .env file that should contain a ESLINT_NO_DEV_ERRORS=true flag. Due to this flag, you will receive the eslint errors as warnings and not as errors in the development.
This flag is ignored during production and when they are any git hooks running, which will, in turn, cause an error when you are trying to commit the code with an eslint error in it.
This is because you already have some other version of eslint installed. To resolve this, first remove that version (in this case 6.8.0) and then again run
npm start
Uninstall the other version using npm uninstall eslint
I started the project with the right versions of everything but somewhere my code broke and started requesting a different version of eslint. "react-scripts" was the only package that had eslint as a dependency.
I tried npm uninstall eslint but it didn't quite work. So I removed react-scripts and then reinstalled it as below
npm uninstall react-scripts
npm install react-scripts.
You might want to install the specific version that was installed before. If your current version is 4.0.3 then when installing just add it at the end like this npm install react-scripts#4.0.3 on step 2 above.
It totally removed the error for me, hope it does for you too.

Not able to create react app, wired error?

I am using the following cmnd to initialize a new react project:
npx create-react-app test
But I get this error :
Invalid "exports" main target "index.js" defined in the package config /usr/lib/node_modules/create-react-app/node_modules/is-promise/package.json
I tried :
1. clear the cache using
npm cache clean --force
2.updating npm to 6.14.4
3. installing it globally npm install create-react-app -g
Following this tread I got the idea, that you need to downgrade the node version to 12.12.0 and error will disappear
Edit: As for now, this bug is fixed in 2.2.2 version of is-promise package. If you still experience problems creating new CRA, consider npm install -g --force create-react-app
If even then bug is still present, please comment your issue to this github issue
Try to complete uninstall node js by using revo uninstaller or delete AppData\Roaming\npm folder . I hope its will be working fine . Also dont forgot to use latest version of node js .
So, apparently the issue is from npm and non of us has done anything wrong, still we can use Yarn to start a new react project while they solve it, follow the steps:
step 1: yarn init -y
step 2: Insert this to package.json
"resolutions": {
"is-promise": "2.1.0",
"run-async/is-promise": "2.1.0"
}
step 3: yarn add --dev create-react-app
step 4: yarn create-react-app ../my-app
There is an error with latest create-react-app version 3.4.1
To proceed while while this is getting fixed, I was able to create a new react project with the previous version of create-react-app 3.4.0
To do this first, please remove create-react-app if you installed it globally
npm uninstall -g create-react-app
Once globally uninstalled you can use npx to create a new project
npx create-react-app#3.4.0 yourProjectName
Use the following exact command:
Exact: npx react-create-app test , Your code is incorrect because react must precede create: npx create-react-app test

Issue with babel-jest dependency when running npm start in a React app

All I am doing is running create-react-app and cd'ing into the app, then trying to run npm/yarn start. I get the following error/output/log. I have walked through all of the suggested steps. The only thing that works is the SKIP_PREFLIGHT_CHECK=true in my .env as the last resort for both
Yarn and npm. I have recently updated to Mojave and had to reinstall my Xcode if people have had a similar experience.
Last login: Tue Oct 30 16:30:24 on ttys002
TheLAB11:~ jasonspiller$ cd repos/react-express-graphql-app/
TheLAB11:react-express-graphql-app jasonspiller$ npm start
> react-express-graphql-app#0.1.0 start /Users/jasonspiller/repos/react-express-graphql-app
> react-scripts start
There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.
The react-scripts package provided by Create React App requires a dependency:
"babel-jest": "23.6.0"
Don't try to install it manually: your package manager does it automatically.
However, a different version of babel-jest was detected higher up in the tree:
/Users/jasonspiller/node_modules/babel-jest (version: 23.4.2)
Manually installing incompatible versions is known to cause hard-to-debug issues.
If prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That will permanently disable this message but you might encounter other issues.
To fix the dependency tree, try following the steps below in the exact order:
1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
2. Delete node_modules in your project folder.
3. Remove "babel-jest" from dependencies and/or devDependencies in the package.json file in your project folder.
4. Run npm install or yarn, depending on the package manager you use.
In most cases, this should be enough to fix the problem.
If this has not helped, there are a few other things you can try:
5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.
This may help because npm has known issues with package hoisting which may get resolved in future versions.
6. Check if /Users/jasonspiller/node_modules/babel-jest is outside your project directory.
For example, you might have accidentally installed something in your home folder.
7. Try running npm ls babel-jest in your project folder.
This will tell you which other package (apart from the expected react-scripts) installed babel-jest.
If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That would permanently disable this preflight check in case you want to proceed anyway.
P.S. We know this message is long but please read the steps above :-) We hope you find them helpful!
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-express-graphql-app#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-express-graphql-app#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/jasonspiller/.npm/_logs/2018-10-30T23_09_42_358Z-debug.log
I just had the same problem. For some reason the package ended up in a node_modules directory in my home directory. It also gave me the exact same error for the jest package.
I'm not sure of the correct way to fix this as npm uninstall -g babel-jest and yarn global remove babel-jest do not do anything.
I fixed it by just blowing away the folders that cause the problem:
bash
rm -rf ~/node_modules/babel-jest ~/node_modules/jest
It would be great to know how those packages ended up there, and the proper way of getting rid of them, but for now just deleting the folders is enough to get CRA dev server running without skipping the preflight check.
This problem can occur if there is node_modules in a parent directory of the folder where you run the application. I solved the problem by deleting the node_modules directory.
I too faced a similar problem and was able to resolve the issue following below steps.
Create a .env file in your project root directory and add the following statement
SKIP_PREFLIGHT_CHECK=true
Save the file
Remove node_modules, yarn.lock, package.lock
Then reinstall node_modules with
npm install
This should work
The problem seems to have reappeared in create-react-app 3.0.0.
The react-scripts package provided by Create React App requires a dependency:
"babel-jest": "24.7.1"
As abisuq pointed out in https://github.com/facebook/create-react-app/issues/6756#issuecomment-489562571 adding a version resolutions into package.json temporarily fixes the problem.
"resolutions": {
"babel-jest": "24.7.1"
},
Update: It has been fixed in create-react-app 3.0.1. If upgrading is an option you can run
npm install --save --save-exact react-scripts#3.0.1
or
yarn add --exact react-scripts#3.0.1
run: npm ls babel-jest
got : babelk-jest#24.7.1 & babel-jest#24.8.0 installed
this means install tow babel-jest with diff version
run:npm uninstall babel-jest#24.8.0 fix my issue
I had this issue and finally solved it easily.
As probably you know, when we use create-react-app, Jest is configured by default and you don't need to install Jest (when we use Webpack, we can install Jest). So, if you use Create-react-app and install Jest by mistake:
Firstly uninstall it (remember that if you use: (npm install --save-dev jest), you can remove jest directly from Package.json or use: (npm uninstall --save-dev jest)
Delete package-lock.json (not package.json)
Delete the node_modules
npm install
Now you don't receive an error and you can easily use: (npm start) or (npm test)
Also, It is worth mentioning that I installed the following tools to write my test in React component:
(npm install --save-dev enzyme enzyme-adapter-react-16 jest-enzyme)
and wrote my test by using jest and enzyme. Then I easily use: (npm test)
Good Luck!
Ok I finally found a solution after trying everything. Here is what finally worked:
First of all, read the error message in the cmd from the beginning. They'll tell you what module is causing the problem. You probably have an older version installed on your computer. Example: babel-jest version 2.4.4
Go to your Node.js folder c:/Users/(your user)/node_modules and find that module and simply delete it.
Go back to the cmd and run npm start. You might get the same error. But it'll be for a different module. Just delete it the same way and repeat until it runs.
I fixed the issue by removing the node_modules folder and package-lock.json file from a folder that was higher than the root of the project. I had installed node_modules accidentally in a higher folder.
I had:
desktop/code/node_modules (remove this to fix)
desktop/code/package-lock.json (remove this to fix)
desktop/code/project/node_modules
desktop/code/project/package-lock.json
I was having this issue as well. When I tried to run the client using npm start, the error would occur, telling me that it required babel-jest: ^24.9.0.
I noticed that in my client, babel-jest was version ^24.9.0, but in my server, I had "jest": "^26.6.3".
All I had to do was change "jest": "^26.6.3" to "jest": "^24.9.0" in the server side source code, delete my package-lock.json as well as node_modules in server, npm install again, and good to go!
At first I installed these (my react version was "^17.0.2")
npm install --save-dev jest
npm install --save-dev enzyme enzyme-to-json
npm install #wojtekmaj/enzyme-adapter-react-17
After that, I had the same problem.
Then I did these steps :)
Added '.env' file in my project root directory and add:
SKIP_PREFLIGHT_CHECK=true
Removed node_modules & package.lock
npm install
npm start
I had the exact same issue.
What I tried was to create the react app outside the directory that had the node_modules folder.
After that, started the app with yarn start and didn't have the error anymore.
I had the same problem, and I fixed this issue. For some reason because node_modules on my local. I removed babel-jest & jest. After that, npm start. I'm not sure this solved incorrect but this correct for me.
I solved this issue by deleting the node_modules folder and package-lock.json file I accidentally had installed in the root of my user.
For me in Mac the path was:
Macintosh HD -> Users -> "My-user-name"
I discover that might be the problem by running npm ls babel-jest on terminal. That showed me that there was another babel-jest up in the tree.
After deleting these two I did npm install in my app where I previously had deleted the node_modules folder and package-lock.json.
Now it's running ok !
I fixed this by deleting node_module folder in the project directory
try this command and see which packages create conflicts in versions.
npm ls babel-jest
replace the conflicted packages with updated one of that package.
I tried all of written solutions above. But none of them worked. I solved problem by deleting "C:\node_modules" folder.
Then delete project node_modules and package-lock.json. Finally, npm install and start again. And it worked.
My react-scripts version is 4.0.3. The problem suddenly happened after installing a private remote package, which installed multiple babel packages in my project root's node_modules. I solved this by installing the problematic packages on the project root's level explicitly, so that they match the versions reported in the preflight check.
Following addings fixed it in my case. Your needed packages and versions may differ, you have to check the preflight report.
yarn add babel-jest#^26.6.0
yarn add babel-loader#8.1.0
For me its still a workaround, but i prefer this way instead of removing something in node_modules manually as suggested in https://stackoverflow.com/a/53093421/4840661.
This is the approach without deleting node_modules:
I recieved error like:
The react-scripts package provided by Create React App requires a dependency:
"jest": "26.6.0"
Don't try to install it manually: your package manager does it automatically.
However, a different version of jest was detected higher up in the tree:
First check the versions using:
npm ls babel-jest
In my case output was like this:
jest#27.0.3
└─┬ #jest/core#27.0.3
└─┬ jest-config#27.0.3
└── babel-jest#27.0.2
After that uninstall babel-jest by
npm uninstall babel-jest
(When you see the single version of babel-jest,otherwise go as versions as follows)
npm uninstall babel-jest#27.0.2
Then install required dependencies using
npm i babel-jest#version jest#version
(Where version is the one come in 1st point)
This works for me like a charm. Hope this solves you too.
Got this error in the netlify ci, here's the fix that worked for me:
this method works for any lib i got a error for eslint instead of babel-jest.
force the error to be shown by npm i -s #babel-jest/VERSION --force
replace VERSION with whatever version shows in the error(23.6.0 in this case),
the correct error message will be shown locally
use https://www.npmjs.com/package/npm-check-updates to upgrade your package.json flie with the correct versions
run ncu -u in dir of package.json after installing the npm package
globally
finally do a npm ci
this will delete the package-lock and node_modules and install the new versions based on the second step
this work for me.
clear caches in npm or yarn
remove node_modules and lock files
create .env file
add " SKIP_PREFLIGHT_CHECK=true " to an .env file in your project.
my issue was that I have both frontend and backend that I am running concurrently. I installed jest to my root project (for backend) and I guess there is collision with pre-installed react jest. I just uninstalled jest from backend and voila I am happy now. I don't have anything related with babel.
i had the similar problem and wasted my 2-3 days
The easiest way to solve this problem is :
1.go outside of src, and create .env file.
2.Inside .env file, just write this single line and save it:
SKIP_PREFLIGHT_CHECK=true
3.then npm start
Hope this helps, Happy coding!!!

Create React App not working

Help! I have no idea what is going on here, create react app is not working I have also tried reinstalling and yet to no avail, please help!
Npm version: 5.4.2
Node version: 8.70
Tried the npm install --save --save-exact --loglevel error react react-dom react-scripts
In my case, "create-react-app" was not installed. to install run this command
npm install -g create-react-app
Once installation successful, try running
npx create-react-app hello-world
If this works for you. Great else comment what worked for you,
Please try this:
npm cache clean --force
I also got the same issue and tried to resolve for a long and finally resolved using this command,
npx create-react-app#latest my-app --use-npm
I had the same problem and had to do the following:
npm uninstall -g create-react-app
npm uninstall create-react-app
After this I was able to create the app with:
npx create-react-app project-app
I had the same problem, and I solved it by:
1. update the npm version (npm install npm#latest -g)
2. clear the cache (npm cache clean --force)
3. create the react project (npx create-react-app todo)
(create-react-app was already installed)
I had similar issue while tried creating new react app with create-react-app, but related to some random JSON reading issues while installations like.. >= 5.0 || 4.0 ..
But the fix below solves multiple and similar issues.
First of all, make sure you have required or latest version of node installed.
npm install npm#latest -g
Before using create-react-app make sure you clean npm cache using npm cache clean --force
Now, is should be fine to create new react app with npx create-react-app tl-app or npx create-react-app . if you want to create current directory as project root.
Make sure you are not running any antivirus, stop/pause all antivirus or protection software.
You can also try
use create-react-app projectname --save
or create-react-app projectname --save-exact and start again
OR
as the error suggests, you should use a newer version of node. You are using 8.9.4, you should probably use 8.12.0 LTS.
It sets up your development environment so that you can use the latest JavaScript features, provides a nice developer experience, and optimizes your app for production.
You’ll need to have Node >= 8.10 and npm >= 5.6 on your machine. To create a project, run:
npx create-react-app my-app
cd my-app
npm start
Note:
npx on the first line is not a typo — it’s a package runner tool that comes with npm 5.2+.
Create react app provides more information regarding this.
It may be the problem of cache also, so can also try:
npm cache clean --force
Edit 1: This may be due to slow internet speed, Please check the
internet and try again.
npx create-react-app .
( the .) means create project on this folder so you should manually create if you do that
For the windows machine following command worked for me
yarn create react-app my-app
cd my-app
yarn set version berry
yarn
yarn start
The problem on my machine was caused by yarn. I am windows 10 and after uninstalling yarn using npm uninstall -g yarn, my script run correctly. So
Open terminal and type: npm uninstall -g yarn
Once done, close terminal and open new one
type create-react-app (app name) and this should create your app :)
Please note that the above steps assume that you already have node and react-cli installed on your machine.
on Ubuntu 18.04
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
What I did, is going to
C:\Users\mycomputerName\AppData\Roaming\npm\
I changed the name of this file
create-react-app.ps1
to
create-react-appOld.ps1
or you can delete it, then it worked fine
Tried all the above methods but no luck:(
Step1 : Reinstalled Node js
Step2 : Check whether environment variables has been created. if not create one for nodejs,npm and composer
Step3: Also add "C:\Windows\System32" to the global PATH environment variable.
Step4: Then use "npx create-react-app my-app" to create react project
Step5: Run the commmand : cd my-app and npm start
Step6: It will work
I finally got it to work. An anti-virus in my system was causing it not to work property. I unistalled it and it's working as expected.
After no luck with updating my npm version and doing npm cache clean --force I ended up just doing a fresh install of node which fixed the issue for me.
HAD the same problem. Running Node with cra. installed cra -g for starters.
npm install -g create-react-app
then downgraded react-scripts to version 2.1.8
npm install react-scripts#2.1.8
created a .env file in root directory and added this to it.
DB_HOST=localhost
DB_USER=root
DB_PASS=s1mpl3
SKIP_PREFLIGHT_CHECK=true
Then you do the typical delete node_modules folder and the package-lock.json file.(NOT PACKAGE.JSON!!!)
then:
npm install
npm start
This worked for me. Sorry I'm not more informative on why this worked for me. I'm still trying to understand why it didn't work in the first place.
I just did it now after messing around with it all yesterday.
Installed react globally like people have said.
then I used 'git bash here' to open terminal in the directory i want
oddly, it worked when I removed npm. I know it's weird, I've never had to do that and it makes no sense but its working so:
create-react-app my-app-name
I'm on windows 10 by the way.
If there is anyone having this issue that you can not find your project when you
yarn create-react-app (name of project)
npx create-react-app (name of project)
then just be sure that you are in the right directory.
use this command in your terminal
cd ..
now search the project name by
cd (project name)
you should find your directory here.
Please do this, I hope it will fix all of your problems
1- npm i -g create-react-app
2- create-react-app my-app
Find the folder and where a folder named npm is present and add it into environment variables (path)
I also experienced the same problem and SOLVED IT.
This is what I did.
Restart your machine(computer)
Deactivate your anti-virus. I chose the "permanently" option
Open the terminal and run the "create-react-app" command again, It will definitely do the trick.
Activate your anti-virus
And get working :-)

Resources