user938363
user938363

Reputation: 10378

Upgrading React native from 0.57 to 0.58.5

After upgrading to React Native 0.58.5 from 0.57, there is an error whenever installing a npm module:

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

Here is the part of 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"
  },

The react version is alreay 16.8.2 which is newer than what the message suggests. What causes the error message? Is the react-native too new?

Upvotes: 1

Views: 1463

Answers (2)

user938363
user938363

Reputation: 10378

I end up reinstalling the whole system and notice that the react version is locked at 16.6.2 which is not the latest one (16.8.2). The problem may be incompatibility issues caused by newer react. Here is part of package.json after re-installation:

 "dependencies": {
    "react": "16.6.3",
    "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-native-navigation": "^2.12.0",
    "react-navigation": "^3.3.2"
  },
  "devDependencies": {
    "babel-core": "7.0.0-bridge.0",
    "babel-jest": "24.1.0",
    "jest": "24.1.0",
    "metro-react-native-babel-preset": "0.52.0",
    "react-test-renderer": "16.6.3"
  },
  "jest": {
    "preset": "react-native"
  }

Upvotes: 0

kenmistry
kenmistry

Reputation: 2143

pertaining to the npm ERR!, you are required to run npm install color -S as the color package is missing from your json file.

hope this helps!

Upvotes: 1

Related Questions