create-react-app is no longer working in my computer anymore - reactjs

create-react-app is no longer working on my computer
A template was not provided. This is likely because you're using an outdated version of create-react-app.
Please note that global installs of create-react-app are no longer supported.
You can fix this by running npm uninstall -g create-react-app or yarn global remove create-react-app before using create-react-app again
I obviously try the npm uninstall -g create-react-app command, but it didn't work.
I tried to update npx, npm, clear cache on npx, on npm, I tried installing the latest version of the create-react-app. nothing worked so far.
npm install create-react-app#latest
npm WARN deprecated tar#2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
added 51 packages, removed 6 packages, changed 12 packages, and audited 68 packages in 2s
4 packages are looking for funding
run `npm fund` for details
3 high severity vulnerabilities
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
I tried uninstalling tar, the exact same message as before appears.

I solved it
the command npm install tar#6 -g
was what I needed to properly update tar and the error disapear.
Thanks to all who took the time to help me

Related

You are running `create-react-app` 4.0.3, which is behind the latest release (5.0.0). We no longer support global installation of Create React App

C:\Users\lg\Desktop> npm uninstall -g create-react-app
up to date, audited 1 package in 216ms
found 0 vulnerabilities
C:\Users\lg\Desktop>npx clear-npx-cache
Need to install the following packages:
clear-npx-cache
Ok to proceed? (y) y
C:\Users\lg\Desktop>npx create-react-app#5.0.0 reduxapp
Need to install the following packages:
create-react-app#5.0.0
Ok to proceed? (y) y
npm WARN deprecated tar#2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
You are running `create-react-app` 4.0.3, which is behind the latest release (5.0.0).
We no longer support global installation of Create React App.
Please remove any global installs with one of the following commands:
- npm uninstall -g create-react-app
- yarn global remove create-react-app
The latest instructions for creating a new app can be found here:
https://create-react-app.dev/docs/getting-started/
C:\Users\lg\Desktop>npm i tar
up to date, audited 153 packages in 1s
6 packages are looking for funding
run `npm fund` for details
3 high severity vulnerabilities
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
C:\Users\lg\Desktop>npx create-react-app#5.0.0 reduxapp
You are running `create-react-app` 4.0.3, which is behind the latest release (5.0.0).
We no longer support global installation of Create React App.
Please remove any global installs with one of the following commands:
- npm uninstall -g create-react-app
- yarn global remove create-react-app
The latest instructions for creating a new app can be found here:
https://create-react-app.dev/docs/getting-started/
I tried to solve it through Googling, but an error seems to occur, and the folder cannot be created.
try clearing npx-cache if you recently ran this on older version.
npx clear-npx-cache
npx install -g create-react-app react-app
The below command worked for me,
npx create-react-app#latest my-app
So these are the steps I did to get it to work:
npm uninstall -g create-react-app
npx create-react-app#latest my-app-name
clearing the npx cache solved the issue for me:
npx clear-npx-cache
Also what one can do is enter the console as administrator, located in the user's folder, and put this command (in my case I used the NPM one)
npm uninstall -g create-react-app
we uninstall it and then I reinstall it
npm install -g create-react-app
and voila, it worked for me
npx clear-npx-cache
npm install -g create-react-app
npx create-react-app#latest my-app
This is happening due to latest version release of create-react-app (5.0.1) all you need to do is first uninstall the previous version of create-react-app by run this command
npm uninstall -g create-react-app
or just update the previous version
npm update -g create-react-app
To solve this issue run this code: npx create-react-app#5.0.1 reduxapp
Pay attention to installing the latest version of create-react-app otherwise, it is not working well.
This happens when you previously ran this on an older version.
Step 1: Try to clear cache by running its command:
npx clear-npx-cache
Step 2: General command to create your app:
npx install -g create-react-app react-app

npx create-react-app won't work and this is what I get

I tried updating node and npm and I uninstalled create-react-app globally but I still got this error please help.
Creating a new React app in /Users/mac/Desktop/monsters-rolodex.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
added 1902 packages, and audited 1903 packages in 59s
153 packages are looking for funding
run npm fund for details
27 vulnerabilities (16 moderate, 9 high, 2 critical)
To address all issues, run:
npm audit fix
Run npm audit for details.
A template was not provided. This is likely because you're using an outdated version of create-react-app.
Please note that global installs of create-react-app are no longer supported.
You can fix this by running npm uninstall -g create-react-app or yarn global remove create-react-app before using create-react-app again.

i want to create react app but i can't. Any help will be appreciated

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS D:\Amazon> npx create-react-app amazon-clone
Creating a new React app in D:\Amazon\amazon-clone.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
added 1919 packages, and audited 1920 packages in 3m
147 packages are looking for funding
run npm fund for details
10 moderate severity vulnerabilities
To address all issues, run:
npm audit fix
Run npm audit for details.
The official documents states "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 or yarn global remove create-react-app to ensure that npx always uses the latest version."
Once you've uninstalled create-react-app package. Clean npm cache using command npm cache clean --force
Try creating a fresh project
npx create-react-app project-app

npm WARN deprecated tar#2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap

I already installed node.js in my machine, But when I try npm install -g create-reactapp it show me error:-
mayankthakur#Mayanks-MacBook-Air ~ % npm install -g create-react-app
npm WARN deprecated tar#2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
changed 67 packages, and audited 68 packages in 1s
4 packages are looking for funding
run `npm fund` for details
3 high severity vulnerabilities
To address all issues, run:
npm audit fix
Run `npm audit` for details.
I got the above isssue
This is not an error. Your tar is outdated. To fix this issue run this command:
npm i tar and enter ok. Now your problem of npm WARN deprecated tar#2.2.2: This version of tar is no longer supported, and will not receive security updates. will be fixed.
Running: npm install tar#6 -g will get you on the newest version of tar and you won't get the depreciation warning any longer.
Currently, as of me writing this, 6.1.11 is the newest version of tar available:
https://www.npmjs.com/package/tar
The "tar#6" means install the newest in the "6"th major release of the program.
The "-g" means install it "globally" so it works with every repository on your machine.
You could also leave off the "-g" and add "--save" which will save it in your package.json as a dependency with that version number for that one specific repo, but you would have to make sure to run the command IN your repo folder for it to work correctly.
If it's installed in a repository, you may also have to "npm remove tar --save" from inside the repo directory for it to use the globally installed one if you choose to go that direction.
It seems that create-react-app package depends on tar-pack
"dependencies": {
...
"tar-pack": "^3.4.1",
...
}
And, tar-pack depends on tar
"dependencies": {
...
"tar": "^2.2.1"
...
}
tar-pack was last updated in 2017 and for a mature package, it makes sense. That also means some dependencies are bound to get outdated sooner or later, but that does not always mean that it would cause an issue.
So, in this case, the warning can be ignored. It should not cause any issues.
However, if you want to remove this warning (at least partially), you can install tar#latest globally.
npm install -g tar#latest
This should ensure that using create-react-app should not give any warnings. If the warnings persist, try removing & installing again.
# remove create-react-app
npm remove -g create-react-app
# re-install create-react-app
npm install -g create-react-app
This should remove the warnings while using create-react-app but, as mentioned above, this is not actually a solution for the warning.
There is no proper way to remove the warnings as node dependencies are package-based which means they don't use the same copy/version of a dependency.
If you update global npm packages, the warning persists.
npm -g update
npm WARN deprecated tar#2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
I suggest you two ways of solving the problem. please check and try this:)
create-react-app appname (type without npm)
npx create-react-app appname
react web site here

how to solve postcss vulnerabilities in app create with create-react-app

I create a new app using create-react-app 1 month ago and recently I got this message from npm update:
80 moderate severity vulnerabilities
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
npm audit gives me:
postcss 7.0.0 - 8.2.9
Severity: moderate
Regular Expression Denial of Service - https://npmjs.com/advisories/1693
fix available via `npm audit fix --force`
Will install react-scripts#2.1.8, which is a breaking change
I try npm audit fix but nothing changes and npm audit fix --force install an older version of react-script (current 4.0.3 to 2.1.8) so it doesn't seem like a good solution.
npm install postcss#latest --save and npm install postcss#8.2.15 --save doesn't change anything either.
What is the best way to fix this vulnerability?
This problem has been answered here: https://stackoverflow.com/a/67502823/8499653
the support for postcss 8 is already merged and probably will be released soon
you can use the npm package npm-force-resolutions to temporarily fix this issue
I lost half a day to this, all the NPM based solutions & packages didn't work. force-resolutions wasn't working for me.
Switching to Yarn makes this far simpler.
rm -rf ./node_modules
rm ./package-lock.json
edit your package.json :
add any other package versions to upgrade from npm / yarn audit here also
"resolutions":
{
"postcss": "^8.2.10"
},
yarn install then running yarn audit should yield the magic words:
0 vulnerabilities found - Packages audited: 999
✨ Done in 1.10s.

Resources