简体   繁体   中英

Error creating react new project. using create-react-app

I am facing issues while creating new project of React . Here is command how I am creating react project.

npx create-react-app helloworld

But project is not creating successfully. Below is screenshot of error React Creating new project

There area that I highlighted in picture changes every time. Sometime showing this error with 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 npm@6.14.4
    3 info using node@v12.16.3
    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 object-assign@4.1.1 checking installable status
201 silly saveTree `-- react@16.13.1
202 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules\react-scripts\node_modules\fsevents):
203 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: 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 ]

Try deleting manually the NPM cache at C:\Users\Shoaib\AppData\Roaming\npm_cache

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM