UNCERTAINTY INDEPENDENCE

I'm having JavaScript issues related to the answer. This is the error caused by chrome when rendering the page:

Uncaught TypeError: Super expression must either be null or a function, not undefined at _inherits (application.js:16301) at application.js:16310 at Object.232.prop-types (application.js:16549) at s (application.js:1) at application.js:1 at Object.233../Collapse (application.js:16574) at s (application.js:1) at application.js:1 at Object.1.react (application.js:78) at s (application.js:1) 

When I set up my reaction using npm, he complains about the equal dependencies of the reaction and the reaction-height:

 ├─┬ UNMET PEER DEPENDENCY react@0.14.9 │ ├─┬ envify@3.4.1 │ │ └─┬ jstransform@11.0.3 │ │ ├── base62@1.1.2 │ │ ├─┬ commoner@0.10.8 │ │ │ ├─┬ commander@2.9.0 ... 

and

 ├─┬ UNMET PEER DEPENDENCY react-height@2.2.1 │ └─┬ create-react-class@15.5.2 │ └─┬ fbjs@0.8.12 │ └── core-js@1.2.7 

After that, I changed the package.json file to:

 "react": "0.14.9", "react-bootstrap": "^0.28.1", "react-collapse": "^2.2.1", "react-dom": "^0.14.3", "react-height": "2.2.1", ... 

After these changes, I completely deleted the node_modules folder with rm -rf , clearing and reinstalling the npm cache.

VERY SUCH problem continues to arise. I notice 2 warnings:

 npm WARN react-collapse@2.4.0 requires a peer of react@ >=15.3 but none was installed. npm WARN react-collapse@2.4.0 requires a peer of react-height@ ^3 but none was installed. 

Is there a problem updating the packages or a problem with being responsive?

+5
source share
1 answer

Your version of react does not meet the requirements of react-collapse . This does not mean that both packages cannot work together, just try and if everything works as intended.

But if you need to fix it, you have two ways to do it:

First way

Remove the line "react": "0.14.9", and run npm i --save react . NPM will install the latest response package. The error must be fixed.


Second way

If you really need to use version 0.14.9 , you should find a react-collapse version that is compatible with your responsejs version.

To do this, enter the npm show react-collapse versions console npm show react-collapse versions - an array entries will appear.

Now we must select one earlier version and check the peerDependencies our selected package.

We use the npm view react-collapse@3.0.0 command, the result will be

enter image description here

Since we selected the version @3.0.0 , which is fine in our case, we need to install it. The following command will do the npm install --save react-collapse@3.0.0 job.

UPDATE

If the above solution does not work. Please install missing peerDependencies manually via npm i --save <package-name> .

Explaination:

Check the npm version by running npm -v . If your version is> 3, then you need to install peer dependencies. I assume this is so, version 3.0.0 was released in mid-2015.

The automatic installation of peer dependencies was explicitly removed using npm 3, as this causes more problems than it tried to solve.

Please read the official npm changelog , you are looking for the "Breaking Change" section.

There is a CLI tool that automatically installs the NPM package and its peer dependencies. You may be interested.

+4
source

Source: https://habr.com/ru/post/1267189/


All Articles