NPX create-react-app aborting installation after vulnerabilities found - reactjs

I have been trying to start learning React and JSX but I have been running into problems with using create-react-app. Every time I have used it eventually states that it is aborting installation and that npm install --save save-exact --loglevel error react react-dom react-scripts has failed. It also state before the installation aborts that there were a number of packages added and a certain number of vulnerabilities found. I have tried searching for other ways to create a React app from scratch and have followed these tutorials to only run into problems and have these fail as well.
Node Version 10.15.2 -- Same error occurred.
Reverted to Node Version 8.15.1 -- Same error still occurs.
NPM version 5.8.0 has not been changed.
npm cache clean --force
Has not changed receiving the error.
If someone could shed some light on what I might try next or what additional information might be helpful I would greatly appreciate it. Thank you. Here is what my screen looks like after trying npx create-react-app my-app
C:\Users\User\Desktop\Programming Courses\YouTube Tutorials\Learn React.js>npx c
reate-react-app my
'0' is not recognized as an internal or external command,
operable program or batch file.
Creating a new React app in C:\Users\User\Desktop\Programming Courses\YouTube Tu
torials\Learn React.js\my.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
'0' is not recognized as an internal or external command,
operable program or batch file.
+ react-dom#16.8.3
+ react#16.8.3
+ react-scripts#2.1.5
added 1813 packages from 716 contributors and audited 36230 packages in 77.867s
found 63 low severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts
has failed.
Deleting generated file... node_modules
Deleting generated file... package.json
Done.
C:\Users\User\Desktop\Programming Courses\YouTube Tutorials\Learn React.js>

Related

Download zip from github and run npm install in root

Any tips on how to resolve this? I am wanting to download the repo so I can make a modification.
When I open the unzipped folder in vscode and run npm install in the root I receive this error.
npm WARN deprecated tslint#6.1.3: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.
> lightweight-charts#4.0.0 postinstall
> npm run install-hooks
> lightweight-charts#4.0.0 install-hooks
> node scripts/githooks/install.js
It seems that it isn't a git repo. Did you use git to clone the repo? Skip installing git-hooks
added 654 packages, and audited 655 packages in 26s
154 packages are looking for funding
run `npm fund` for details
5 high 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
Run `npm audit` for details.
You can ignore the error since you didn't clone the repo but instead downloaded it as a zip file. You will still be able to build the library.
I would recommend reading the BUILDING.md file if you are getting started with developing for the library.
The git hooks are only used when creating a new commit, at which stage it will run some checks to ensure that the code passes a few linter rules.

How can I fix npx create-react-app error?

I'm having trouble making a react project for the first time and I'm basically doing npx create-react-app portfolio and this is the log in the terminal
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! Unexpected end of JSON input while parsing near '...w2l6C\nBZrjaE2TabX86o'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ITland\AppData\Roaming\npm-cache\_logs\2020-06-13T14_28_52_450Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts
cra-template has failed.
Deleting generated file... package.json
Deleting portfolio/ from C:\Users\ITland\Desktop\New folder (2)
Has anyone any idea what's causing this error ?
The Log message shown above indicates that the npx command was run inside the folder -
C:\Users\ITland\Desktop\New folder (2)
The npm command can sometimes fail on Windows due to blank spaces or special chars in the folder names.
It is always recommended to avoid spaces and special characters in the folder names where npm is run.
The above problem may be resolved by running the npm / npx command inside
C:\Users\ITland\Desktop\New_folder_2
Try running the below command
npm cache clean --force
Once this is successful, try doing what you are looking for.
Try with the following way:
npm cache clean --force
If you are a windows user, try deleting all files in this folder:
C:\Users{{your-username}}\AppData\Roaming\npm-cache
Then...
npm cache verify
If that doesn't work, try updating to the lastest
npm i npm#latest -g

React-Router causing 12969 high severity vulnerabilities

Starting a new project using
npx create-react-app my-app --typescript
I had no errors, I installed
npm install --save react-router-dom #types/react-router-dom
And get the error
mixin-deep#2.0.1 added 1 package from 1 contributor, updated 1
package, moved 1 package and audited 902212 packages in 13.484s found
12969 high severity vulnerabilities
I'm running Node v12.6.0 & npm 6.10.1 on a Windows PC. I've tried running npm audit fix, but it states I have to fix them manually.
Installing react-router and getting 12969 high severity vulnerabilities seems a little excessive, does anyone know what's going on? Am I doing something wrong?

How can i correct the error i keep getting in creating a react app

Each time i tried creating a react app using create-react-app <...name> i keep getting this error "
Creating a new React app in C:\windows\system32\brian-todos.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
npm ERR! Unexpected end of JSON input while parsing near '...tXcMskoaoOolrubJ3NQGh'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\BrianMartinez\AppData\Roaming\npm-cache_logs\2019-01-12T13_11_25_580Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts has failed.
Deleting generated file... package.json
Deleting brian-todos / from C:\windows\system32
Done."
I even tried npm clear cache it still didn't not work.What do i do about this challenge
It seems you opened your windows console or powershell as an administrator, and you landed in system32 folder. Don't create your project there, that is a reserved folder for system executables. Do something like cd C:\Users\yourusername\Documents and try there.
This is the answer to the challenge i had before now. follow these steps
npm install -g yarn
yarn global add create-react-app
create-react-app

react-scripts missing after install redux

i created react app according steps described here https://www.sitepoint.com/getting-started-react-beginners-guide/
npm i -g create-react-app
create-react-app myapp
yarn start
Everything worked ok, so i tried install redux as it described here
https://redux.js.org/docs/basics/UsageWithReact.html
npm install --save react-redux
I got this message
react-redux#5.0.7
added 3 packages, removed 1061 packages and updated 18 packages in 14.541s
and now when i try
yarn start
i get message
yarn run v1.3.2
$ react-scripts start
'react-scripts' is not recognized as an internal or external command,
operable program or batch file.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Whats wrong? I don't understand why is react-scripts not working. I thought that --save adds the third-party package to the package's dependencies and have nothing to do with other packages.
Iam thankfull for every advice what i did wrong and how to fix it.
Thanks
Instead of npm install --save react-redux you should install redux package using yarn.
yarn add redux
issue :
You are creating app using yarn package manager and then adding new packages using npm causing to eject the packages installed using yarn.
Because of this react-scripts getting remove throwing the error.

Resources