create-react-app 報錯 Unexpected end of JSON input while parsing near '

按照官方文檔安裝create-react-app後,執行npx create-react-app後報錯:react

Unexpected end of JSON input while parsing near ......npm

執行下面命令可解決服務器

npm cache clean --force ,

:執行後能夠用如下命令檢查app

npm cache verify

若是仍是不行,查看一下npm版本,不是最新的更新一下: spa

npm i -g npm

再有就是試一下換npm的鏡像服務器(實測,這個也不行)code

npm config set registry http://registry.cnpmjs.org
或(這個是原始服務器)
npm config set registry http://registry.npmjs.org
或(實測國內最快)
npm config set registry https://registry.npm.taobao.org

 最後項目建立成功:blog

相關文章
相關標籤/搜索