create-react-app : npm ERR!解析“...."附近时 JSON 输入意外结束 [英] create-react-app : npm ERR! Unexpected end of JSON input while parsing near '....'
本文介绍了create-react-app : npm ERR!解析“...."附近时 JSON 输入意外结束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
npx create-react-app my-app
对我不起作用我试过 npm cache clean --force
但我一次又一次地得到同样的错误
npx create-react-app my-app
doesn't work for me
i tried npm cache clean --force
but i get the same error again and again
npm 缓存清理 --force
- npm/
npx create-react-app front
npm init react-app front
npx: installed 98 in 37.068s
Creating a new React app in /home/h4kst3r/Desktop/APIs/restaurant-API/front.
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 '...zAJNgZjZUkJ08ybAxwNnR'
npm ERR! A complete log of this run can be found in:
npm ERR! /home/h4kst3r/.npm/_logs/2020-05-20T20_47_49_189Z-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 front/ from /home/h4kst3r/Desktop/APIs/restaurant-API
Done.
系统:
操作系统:Linux 5.4 Ubuntu 20.04 LTS (Focal Fossa)
System:
OS: Linux 5.4 Ubuntu 20.04 LTS (Focal Fossa)
推荐答案
这是因为网速慢.所以等到你的互联网连接正常.或者一一安装所有依赖.
Its happened because of slow internet . So wait till ur internet connection is normal. Or install all dependencies one by one .
这篇关于create-react-app : npm ERR!解析“...."附近时 JSON 输入意外结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文