[英]Encounter error when installing react-router-dom
I get this error whenever I NPM install react-router-dom in vs code:每当我 NPM 在 vs 代码中安装 react-router-dom 时,我都会收到此错误:
npm ERR!
npm 错误! Unexpected end of JSON input while parsing near '...stack-launcher":"^1.0'
在 '...stack-launcher":"^1.0' 附近解析时 JSON 输入意外结束
npm ERR!
npm 错误! A complete log of this run can be found in: npm ERR!
可以在以下位置找到此运行的完整日志:npm ERR!
C:\\Users\\HP\\AppData\\Roaming\\npm-cache_logs\\2019-03-18T09_03_43_417Z-debug.logC:\\Users\\HP\\AppData\\Roaming\\npm-cache_logs\\2019-03-18T09_03_43_417Z-debug.log
This solved it for me 这为我解决了
npm cache clean --force
then run 然后跑
npm i react-router-dom
Seems like you missed a comma after '...stack-launcher":"^1.0'
in the package.json file. 似乎您在package.json文件中的
'...stack-launcher":"^1.0'
之后错过了逗号。
If not delete the node_modules
folder, delete package-lock.json
file, run npm cache clean --force
and try to re-install. 如果不删除
node_modules
文件夹,删除package-lock.json
文件,运行npm cache clean --force
并尝试重新安装。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.