I run xcode project prompted the following error:
[tid:main] Unable to resolve module react from /Users/chenchen/Documents/project/mywebsite/index.ios.js: Unable to find this module in its module map or any of the node_modules directories under /Users/node_modules/react and its parent directories
Do the checklist before filing an issue:
This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
watchman watch-del-all.node_modules folder: rm -rf node_modules && npm install.rm -fr $TMPDIR/react-* or npm start -- --reset-cache.I follow the above instructions, but still valid
@XiaoLiz I think this could be a problem with PATH+npm on windows.
Please try the following:
reinstall all to latest:
npm: 3.10.3
node: 6.3.0
react-native: ^0.29.0
react: 15.2.1
Then:
rm -rf node_modules
npm clean cache
watchman watch-del-all
npm i
npm start -- --reset-cache
@stoffern The need to install npm install react ?
@XiaoLiz Yes, react-native uses react framework to get its structure.
import React, {Component} from 'react'
@stoffern According to the above process still not been resolved
@XiaoLiz can you post your index.ios.js code?
@stoffern
This is init project index.ios.js
/**
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
class mywebsite extends Component {
render() {
return (
Cmd+D or shake for dev menu
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
AppRegistry.registerComponent('mywebsite', () => mywebsite);
@XiaoLiz no problems there.
is your project located here: /Users/chenchen/Documents/project/mywebsite ?
what happends if you run:
./node_modules/react-native/packager/packager.sh start --reset-cache
@stoffern
Yes ! my project located here: /Users/chenchen/Documents/project/mywebsite
my run:
./node_modules/react-native/packager/packager.sh start --reset-cache

@XiaoLiz is your package.json and your node_modules folder inside: /Users/chenchen/Documents/project/mywebsite ?
@stoffern
Yes !
@XiaoLiz
you not install react
npm i --save react
不谢!
Looks like this has been solved.
Most helpful comment
@XiaoLiz
you not install
react不谢!