facebookarchive/react-native-samples

Unable to resolve module `react/lib/ReactComponentWithPureRenderMixin`

ugultopu opened this issue · 1 comments

OS: macOS Sierra
Node: v7.9.0. Installed with NVM script.

Commands:

cd react-native-samples/packages/gist-lister-app
npm install

Output:

...
npm WARN react-test-renderer@15.4.2 requires a peer of react@^15.4.2 but none was installed.

Commands:

react-native eject
react-native run-ios

Build succeeds. However, output of packager:

...
error: bundling: UnableToResolveError: Unable to resolve module `react/lib/ReactComponentWithPureRenderMixin` from `react-native-samples/packages/gist-lister-app/node_modules/react-native/Libraries/react-native/react-native-implementation.js`: Module does not exist in the module map or in these directories:
  react-native-samples/packages/gist-lister-app/node_modules/react-native/node_modules/react/lib
,   react-native-samples/packages/gist-lister-app/node_modules/react/lib

This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
  1. Clear watchman watches: `watchman watch-del-all`.
  2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
  3. Reset packager cache: `rm -fr $TMPDIR/react-*` or `npm start --reset-cache`.
    at p.catch.error (react-native-samples/packages/gist-lister-app/node_modules/react-native/packager/src/node-haste/DependencyGraph/ResolutionRequest.js:366:19)
    at process._tickCallback (internal/process/next_tick.js:109:7)
Bundling `index.ios.js`  66.0% (13/16), failed.

What am I missing here?

Regards

It somehow worked when I used Yarn. Not sure if using Yarn fixed the issue though. Anyways, the commands I followed are as follows:

git clone https://github.com/fbsamples/react-native-samples.git
cd react-native-samples/packages/gist-lister-app
yarn install
react-native eject
react-native run-ios