最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

javascript - How to resolve npm dependency - Stack Overflow

matteradmin6PV0评论

[email protected] requires a peer of react@^15.0.0 but none is installed. You must install peer dependencies yourself.

I am very new to React. I installed the following open source project:

npm install --save react-tag-autoplete.

I was following the documentation stated here:

From the looks of it, I feel I have an older version of React. Am I correct? How can I fix it?

Here is the package.json

{
  "name": "reacttaggautoplete",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "react": "^16.2.0",
    "react-dom": "^16.2.0",
    "react-scripts": "1.1.0",
    "react-tag-autoplete": "^5.5.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  }
}

[email protected] requires a peer of react@^15.0.0 but none is installed. You must install peer dependencies yourself.

I am very new to React. I installed the following open source project:

npm install --save react-tag-autoplete.

I was following the documentation stated here: https://www.npmjs./package/react-tag-autoplete

From the looks of it, I feel I have an older version of React. Am I correct? How can I fix it?

Here is the package.json

{
  "name": "reacttaggautoplete",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "react": "^16.2.0",
    "react-dom": "^16.2.0",
    "react-scripts": "1.1.0",
    "react-tag-autoplete": "^5.5.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  }
}
Share Improve this question edited Dec 2, 2018 at 15:05 Roy Scheffers 3,90811 gold badges33 silver badges36 bronze badges asked Feb 5, 2018 at 14:21 JavaDeveloperJavaDeveloper 5,68019 gold badges89 silver badges143 bronze badges 1
  • Does the project work with react@15 missing? It may be fine with react@16 and react-tag-autoplete's package.json just needs to bump their peer dependency version. – bcr Commented Feb 5, 2018 at 14:31
Add a ment  | 

2 Answers 2

Reset to default 1

Aparently you have installed React 16.2 so I'm guessing the problem is that react-tag-autoplete hasn't been updated to be used with the newer versions of react.

You could change the react dependency to "react": "^15.0.0" and then do a npm update and you should be fine (that will downgrade you to react 15).

Install the package to solve it

npm install react@^15.0.0
Post a comment

comment list (0)

  1. No comments so far