Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
471 views
in Technique[技术] by (71.8m points)

javascript - module schedule/tracking does not exist in the Haste module map

React Native Environment Info:

System:
  OS: macOS High Sierra 10.13.6
  CPU: x64 Intel(R) Core(TM) i3-7100 CPU @ 3.90GHz
  Memory: 559.26 MB / 16.00 GB
  Shell: 3.2.57 - /bin/bash
Binaries:
  Node: 10.11.0 - /usr/local/bin/node
  npm: 6.4.1 - /usr/local/bin/npm
  Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
  iOS SDK:
    Platforms: iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0
IDEs:
  Xcode: 10.0/10A255 - /usr/bin/xcodebuild
npmPackages:
  react: 16.0.0 => 16.0.0 
  react-native: ^0.57.3 => 0.57.3 
npmGlobalPackages:
  react-native-cli: 2.0.1

here is react-native info similar solutions from GitHub does not work for me

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The error appears due to the renaming of schedule/tracking to schedule/tracing from [email protected] to [email protected].

The issue is resolved by choosing the correct version of react for your react-native version:

  • RN <= 0.57.2 --> react <= 16.5.1
    • Be sure to lock your react version in this case. Your package.json should look like this: [email protected]. Check that there isn't any ^ before the version.
    • (having react@^16.5.1 in your package.json may resolve to a react version >= 16.5.1, which will NOT work)
    • example command: yarn add [email protected]
  • RN >= 0.57.3 --> react >= 16.6

For further Information you can check the Github Issue #21150 and Github Issue #21140.

Sidenote for Expo Users:

If you are using expo, be aware that expo <= 32.0.0 uses a react-native version <= 0.57.2 and therefore will require the react version to be <= 16.5.1

If it does not work immediately

Try to reset the cache of your packager before continuing: yarn start --reset-cache


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...