'Error creating react new project. using create-react-app
I am facing issues while creating a new project for React. Here is the command for how I am creating react project.
npx create-react-app helloworld
But the project is not created successfully. Below is a screenshot of the error React Creating new project
The area that I highlighted in the picture changes every time. Sometimes showing this error with a different file. and sometimes the response time error mentioned below: Response time error
I have tried following solutions:
npm config set registry="http://registry.npmjs.org/"
npm cache clean --force
- Reinstalling node.js
I am attaching few lines of log file in this post. Kindly help me out in resolving this problem.
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '--save',
1 verbose cli '--save-exact',
1 verbose cli '--loglevel',
1 verbose cli 'error',
1 verbose cli 'react',
1 verbose cli 'react-dom',
1 verbose cli 'react-scripts',
1 verbose cli 'cra-template'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session a2a652d86a598482
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 304 http://registry.npmjs.org/react 258ms (from cache)
8 http fetch GET 304 http://registry.npmjs.org/react-dom 258ms (from cache)
9 http fetch GET 304 http://registry.npmjs.org/react-scripts 265ms (from cache)
10 silly pacote tag manifest for react@latest fetched in 296ms
11 silly pacote tag manifest for react-scripts@latest fetched in 281ms
12 silly pacote tag manifest for react-dom@latest fetched in 283ms
13 http fetch GET 304 http://registry.npmjs.org/cra-template 281ms (from cache)
26 http fetch GET 304 http://registry.npmjs.org/object-assign 73ms (from cache)
27 http fetch GET 304 http://registry.npmjs.org/loose-envify 74ms (from cache)
28 http fetch GET 304 http://registry.npmjs.org/prop-types 73ms (from cache)
29 silly pacote range manifest for object-assign@^4.1.1 fetched in 77ms
30 silly resolveWithNewModule [email protected] checking installable status
201 silly saveTree `-- [email protected]
202 warn optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\react-scripts\node_modules\fsevents):
203 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
204 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
204 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any
204 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: win32
204 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
205 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...cript-eslint/parser",'
205 verbose stack at JSON.parse (<anonymous>)
205 verbose stack at parseJson (C:\Program Files\nodejs\node_modules\npm\node_modules\json-parse-better-errors\index.js:7:17)
205 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\body.js:96:50
205 verbose stack at processTicksAndRejections (internal/process/task_queues.js:97:5)
206 verbose cwd H:\React\helloworld
207 verbose Windows_NT 10.0.18363
208 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save" "--save-exact" "--loglevel" "error" "react" "react-dom" "react-scripts" "cra-template"
209 verbose node v12.16.3
210 verbose npm v6.14.4
211 error Unexpected end of JSON input while parsing near '...cript-eslint/parser",'
212 verbose exit [ 1, true ]
Solution 1:[1]
Try deleting manually the NPM cache at C:\Users\Shoaib\AppData\Roaming\npm_cache
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |