can not create react app Unexpected end of JSON input while parsing near '...webpack-dev-middlewar'
See original GitHub issueIs this a bug report?
(write your answer here) yes
Did you try recovering your dependencies?
(Write your answer here.) There is actually no package.json preinstalled .
Which terms did you search for in User Guide?
(Write your answer here if relevant.)
Environment
(paste the output of the command here) $ npx create-react-app react-spa-demo npx: 91 安装成功,用时 46.343 秒
Creating a new React app in D:\WebstormProjects\react-spa-demo.
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 ‘…webpack-dev-middlewar’
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\lenovo\AppData\Roaming\npm-cache_logs\2019-06-22T07_18_33_539Z-debug.log
Aborting installation. npm install --save --save-exact --loglevel error react react-dom react-scripts has failed.
Deleting generated file… package.json Deleting react-spa-demo/ from D:\WebstormProjects Done.
Steps to Reproduce
(Write your steps here:)
- npx create-react-app react-spa-demo
Expected Behavior
(Write what you thought would happen.) create this app successfully without exceptions
Actual Behavior
(Write what happened. Please add screenshots!) $ npx create-react-app react-spa-demo npx: 91 安装成功,用时 46.343 秒
Creating a new React app in D:\WebstormProjects\react-spa-demo.
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 ‘…webpack-dev-middlewar’
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\lenovo\AppData\Roaming\npm-cache_logs\2019-06-22T07_18_33_539Z-debug.log
Aborting installation. npm install --save --save-exact --loglevel error react react-dom react-scripts has failed.
Deleting generated file… package.json Deleting react-spa-demo/ from D:\WebstormProjects Done.
Reproducible Demo
(Paste the link to an example project and exact instructions to reproduce the issue.)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:56 (1 by maintainers)
Top GitHub Comments
Hi @Evan-Tsai17, can you please try running
npm cache clean --force
, and then try again?I think this is a local caching issue.
This worked for me. Thanks