좋아요, 필자는 기능이있는 react-native-web 브랜치를 설치하려고 필사적으로 노력하고 있습니다. ListView 구성 요소. This branch, 구체적으로는 이 문제를 가지고하지 않는 것 react-native-web
에서 직접 설치 npm install --save [email protected] [email protected] https://github.com/IjzerenHein/react-native-web/tarball/feaure-listview2
오류 : 모듈 "react-native"/ 모듈을 찾을 수 없습니다 : 오류 : 모듈 'react-native-web'을 해결할 수 없습니다
:
나는과 같이 프로젝트 디렉토리로 설치되어 있어야합니다.이
은 index.web.js의 모습입니다 : (! 그것의 일부, 거기에 너무 많은 텍스트를) 여기import React from 'react'
import {
AppRegistry,
Component,
...
} from 'react-native';
class App extends Component {
...
}
// App registration and rendering
AppRegistry.registerComponent('App',() => App);
AppRegistry.runApplication('App', { rootTag: document.getElementById('react-root') });
콘솔이 나에게 말해 무엇 :
[Error] ./index.web.js
Module not found: Error: Cannot resolve module 'react-native-web' in /Users/michael/Code/spectrum-react-native
resolve module react-native-web in /Users/michael/Code/spectrum-react-native
looking for modules in /Users/michael/Code/spectrum-react-native/node_modules
resolve 'file' react-native-web in /Users/michael/Code/spectrum-react-native/node_modules
resolve file
/Users/michael/Code/spectrum-react-native/node_modules/react-native-web is not a file
/Users/michael/Code/spectrum-react-native/node_modules/react-native-web.webpack.js doesn't exist
/Users/michael/Code/spectrum-react-native/node_modules/react-native-web.web.js doesn't exist
/Users/michael/Code/spectrum-react-native/node_modules/react-native-web.js doesn't exist
/Users/michael/Code/spectrum-react-native/node_modules/react-native-web.json doesn't exist
resolve 'file' or 'directory' /Users/michael/Code/spectrum-react-native/node_modules/react-native-web
resolve file
/Users/michael/Code/spectrum-react-native/node_modules/react-native-web is not a file
/Users/michael/Code/spectrum-react-native/node_modules/react-native-web.webpack.js doesn't exist
/Users/michael/Code/spectrum-react-native/node_modules/react-native-web.web.js doesn't exist
/Users/michael/Code/spectrum-react-native/node_modules/react-native-web.js doesn't exist
/Users/michael/Code/spectrum-react-native/node_modules/react-native-web.json doesn't exist
resolve directory
directory default file index
resolve file index in /Users/michael/Code/spectrum-react-native/node_modules/react-native-web
/Users/michael/Code/spectrum-react-native/node_modules/react-native-web/index doesn't exist
/Users/michael/Code/spectrum-react-native/node_modules/react-native-web/index.webpack.js doesn't exist
/Users/michael/Code/spectrum-react-native/node_modules/react-native-web/index.web.js doesn't exist
/Users/michael/Code/spectrum-react-native/node_modules/react-native-web/index.js doesn't exist
/Users/michael/Code/spectrum-react-native/node_modules/react-native-web/index.json doesn't exist
use dist/index.js from package.json
resolve 'file' or 'directory' dist/index.js in /Users/michael/Code/spectrum-react-native/node_modules/react-native-web
resolve file
/Users/michael/Code/spectrum-react-native/node_modules/react-native-web/dist/index.js doesn't exist
/Users/michael/Code/spectrum-react-native/node_modules/react-native-web/dist/index.js.webpack.js doesn't exist
/Users/michael/Code/spectrum-react-native/node_modules/react-native-web/dist/index.js.web.js doesn't exist
/Users/michael/Code/spectrum-react-native/node_modules/react-native-web/dist/index.js.js doesn't exist
/Users/michael/Code/spectrum-react-native/node_modules/react-native-web/dist/index.js.json doesn't exist
resolve directory
/Users/michael/Code/spectrum-react-native/node_modules/react-native-web/dist/index.js doesn't exist (directory default file)
/Users/michael/Code/spectrum-react-native/node_modules/react-native-web/dist/index.js/package.json doesn't exist (directory description file)
...
@ ./index.web.js 9:19-42
errors (bundle.js:7934)
onmessage (bundle.js:7969)
dispatchEvent (bundle.js:2874)
(anonymous function) (bundle.js:4908)
forEach
_transportMessage (bundle.js:4906)
(anonymous function)
emit (bundle.js:847)
onmessage (bundle.js:6261)
방금 답변을 추가했습니다. 명확하지 않은 것이 있으면 알려주세요. –