升级React native从0.57升级到0.58.5

问题描述 投票:0回答:2

从0.57升级到React Native 0.58.5后,安装npm模块时出错:

npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm ERR! path C:\d\code\js\emps\node_modules\colors
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\d\code\js\emps\node_modules\colors' -> 'C:\d\code\js\emps\node_modules\.colors.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\JunC\AppData\Roaming\npm-cache\_logs\2019-02-25T23_49_59_940Z-debug.log

这是package.json的一部分:

"dependencies": {
    "react": "^16.8.2",
    "react-native": "^0.58.5",
    "react-native-code-push": "^5.5.2",
    "react-native-device-info": "^0.26.4",
    "react-native-gifted-chat": "^0.7.2",
    "react-navigation": "^3.3.0"
  },

qazxsw poi版本已经是qazxsw poi,它比消息所暗示的更新。是什么导致错误消息? react太新了吗?

reactjs react-native
2个回答
1
投票

属于16.8.2,你需要运行react-native,因为你的json文件中缺少npm ERR!包。

希望这可以帮助!


0
投票

我最终重新安装整个系统,并注意到反应版本锁定在16.6.2,这不是最新版本(16.8.2)。问题可能是由较新的反应引起的不兼容问题。重新安装后,这是npm install color -S的一部分:

color
© www.soinside.com 2019 - 2024. All rights reserved.