简体   繁体   中英

Encounter error when installing react-router-dom

I get this error whenever I NPM install react-router-dom in vs code:

在此处输入图片说明

npm ERR! Unexpected end of JSON input while parsing near '...stack-launcher":"^1.0'

npm ERR! A complete log of this run can be found in: npm ERR!
C:\\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.

If not delete the node_modules folder, delete package-lock.json file, run npm cache clean --force and try to re-install.

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