yuanyan / react-native-web-example

React Native Web Example
40 stars 24 forks source link

run example error Cannot resolve module #1

Open zhonshu opened 8 years ago

zhonshu commented 8 years ago

zhongshudeMacBook-Pro:react-native-web-example zhongshu$ npm install npm WARN react-hot-api@0.4.7 requires a peer of react@>=0.11.0 || ^0.14.0-rc but none was installed. npm WARN react-hot-loader@1.2.7 requires a peer of react@>=0.11.0 but none was installed. npm WARN react-web@0.1.5 requires a peer of react@~0.14.0 but none was installed. npm WARN react-web@0.1.5 requires a peer of react-dom@~0.14.0 but none was installed. npm WARN react-native-web-example@0.0.1 No repository field. npm WARN react-native-web-example@0.0.1 No license field. zhongshudeMacBook-Pro:react-native-web-example zhongshu$ npm run web-dev

I run npm run web-dev errors

ERROR in ./index.ios.js Module not found: Error: Cannot resolve module 'react/lib/ReactMount' in /Users/zhongshu/Documents/react/react-native-web-example @ ./index.ios.js 1:346-377

ERROR in ./index.ios.js Module not found: Error: Cannot resolve module 'react' in /Users/zhongshu/Documents/react/react-native-web-example @ ./index.ios.js 1:387-403 76:375-391

ERROR in ./~/react-web/lib/react-web.js Module not found: Error: Cannot resolve module 'react' in /Users/zhongshu/Documents/react/react-native-web-example/node_modules/react-web/lib @ ./~/react-web/lib/react-web.js 13:13-29

ERROR in ./~/react-web/lib/ActivityIndicator/ActivityIndicator.web.js Module not found: Error: Cannot resolve module 'react' in /Users/zhongshu/Documents/react/react-native-web-example/node_modules/react-web/lib/ActivityIndicator @ ./~/react-web/lib/ActivityIndicator/ActivityIndicator.web.js 11:13-29

ERROR in ./~/react-web/lib/DrawerLayout/DrawerLayout.web.js Module not found: Error: Cannot resolve module 'react' in /Users/zhongshu/Documents/react/react-native-web-example/node_modules/react-web/lib/DrawerLayout @ ./~/react-web/lib/DrawerLayout/DrawerLayout.web.js 17:13-29

ERROR in ./~/react-web/lib/Image/Image.web.js Module not found: Error: Cannot resolve module 'react' in /Users/zhongshu/Documents/react/react-native-web-example/node_modules/react-web/lib/Image @ ./~/react-web/lib/Image/Image.web.js 13:13-29

craone commented 8 years ago

npm install react

zhonshu commented 8 years ago

zhongshudeMacBook-Pro:react-native-web-example zhongshu$ npm run web-dev

react-native-web-example@0.0.1 web-dev /Users/zhongshu/Documents/react/react-native-web-example node web/start-dev-server

Listening at 0.0.0.0:3000 Crawl: 1114ms [BABEL] Note: The code generator has deoptimised the styling of "/Users/zhongshu/Documents/react/react-native-web-example/web/output/bundle.js" as it exceeds the max of "100KB". Hash: a4ae61101b75c26a035b Version: webpack 1.9.10 Time: 18386ms Asset Size Chunks Chunk Names bundle.js 3.11 MB 0 [emitted] main bundle.js.map 4.72 MB 0 [emitted] main index.html 310 bytes [emitted]
chunk {0} bundle.js, bundle.js.map (main) 3 MB [rendered] [0] multi main 52 bytes {0} [built]

........

[403] ./web/output/bundle.js 1.32 MB {0} [built] [404] ./~/react-hot-loader/makeExportsHot.js 1.38 kB {0} [built] [405] ./~/react-hot-loader/isReactClassish.js 801 bytes {0} [built] [406] ./~/react-hot-loader/isReactElementish.js 288 bytes {0} [built] webpack: bundle is now VALID.