React-native@0.26.3 requires a peer of react@15.0.2 but none was installed

后端 未结 4 1444
离开以前
离开以前 2021-02-19 12:23

I am trying to set up for the react native. but whenever I update files it gives m error

    enoent ENOENT: no such file or directory, open \'React Native/packa         


        
4条回答
  •  离开以前
    2021-02-19 12:43

    In my case, the project I am working on requires a specific version of React. Since it was older than the current release, doing an install/update would still cause the error.

    In order to fix the problem, I had to check the package.json of the project and install the exact version allowed by the dependency definition. In the OP's case, a

    npm install react@15.0.2
    

    should fix the problem by installing the exact version of the React module that react-native requires.

    Verify that the condition was resolved by doing a npm list to see if there are any other unmet peer dependencies.

提交回复
热议问题