简体   繁体   中英

How to fix Error in installing "react-router-dom?

I got error while installing the react-router-dom.
错误图片

D:\react\routeingreact>npm i react-router-dom
npm ERR! Cannot read property 'match' of undefined

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\5442\AppData\Roaming\npm-cache\_logs\2020-04-01T05_06_17_337Z-debug.log

You are attempting to install the wrong package. There is no package router-react-dom . You are looking for react-router-dom . You mixed up the order of the words react and router in your install command. The correct install command would be:

npm install react-router-dom

I'd recommend reviewing the getting started guide for react-router-dom also.

Hopefully that helps!

You need to delete one file and one directory:

  • package-lock.json
  • node_modules

That should you get you back on track

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