Error while installing create-react-app globally using npm - reactjs

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"

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

While creating a react app I'm getting following error or errors

I ran create-react-app and get this error message I did the followings like uninstalling global and so no but getting the same again and again.
You are running `create-react-app` 4.0.0, which is behind the latest release (4.0.1).
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/
npm ERR! code 1
npm ERR! path J:\Akhlak_hossain_jim
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c ""create-react-app" "ahj-app" "--use-npm""
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Akhlak Hossain Jim\AppData\Local\npm-cache\_logs\2020-11-24T15_16_27_423Z-debug.log
Edit:
I've also tried the following:
Using npx instead. - but that's not working and is showing the above error message.
Uninstalled create-react-app using npm uninstall -g create-react-app before running npx create-react-app ahj-app - however that also doesn't work.
npm install -g create-react-app
Above worked for me.
Do not use npm to install "create-react-app" instead use npx this way:
npx create-react-app my-app
it will always use the lastest version
I solved this using the following command.
npm uninstall -g create-react-app
then again install
npm install -g create-react-app
PS D:\ReactProjects> npx create-react-app sample-app
Creating a new React app in D:\ReactProjects\sample-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npx create-react-app#5.0.0 ahj-app
Specify the latest version explicitly when creating new app

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

I am trying to set up the working enviroment for Rejact JS. When I run npm install in command prompt. Its show this error, any advise?

I am trying to set up the working environment for Rejact JS, but I get this error when I run npm install:
Of course I have my package.json here:
[package.json][1]
I just run npm install or npm install -d to load the model but the issues is as below here:
npm install error

npm error: 'specify configs in the ini-formatted file:' \User\.npmrc

NOOB here, trying to follow this React tutorial: https://github.com/reactjs/react-tutorial/
The README.md file says to:
npm install
node server.js
After cloning the repo, I ran npm install and a bunch of stuff (modules?) downloaded. But when I try to run npm server.js and I'm hit with this message:
Specify configs in the ini-formatted file:
C:\Users\User\.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
npm#3.3.6 C:\Program Files\nodejs\node_modules\npm
C:\Users\User\.npmrc contains this:
key=
Any ideas on how to get the npm server up and running? Do I need to set the key in this file to something?
the correct way to start the server would be
npm run server.js
Try out below command if trying to start NextJS react
npm run-script start
Use npx instead of npm:
npx create-react-app my-app
try like below command without npm
Ex: create-react-app app-name .(without npm)
Steps worked for me
Create a folder ".npmrc" under the path it is complaining
Set the cache location using command npm config set cache 'path to npmrc folder' --global
Try running npm install package now
It should be with a space:
npm install #angular/material --save
If you are using Angular 2+:
Check the content of the file package.json into "scripts", as image below
Then you would use in terminal:
npm run ng or
npm run start etc.
In my case I was executing without run and becase of this I got the same error as you.
Now, using runis ok!

Resources