2017-10-09 2 views
2

나는 npm start -- --reset-cache으로 실행중인 React-Native 응용 프로그램을 가지고 있습니다. 그런 다음 react-native run-android을 실행합니다.번들링에 실패했습니다 : 오류 및 Re-Native 프로젝트를 실행할 때의 404

그러나, 나는이 npm 서버의 콘솔에서이 문제를 받고 있어요 : 안드로이드 에뮬레이터에서, 다음

Bundling `index.js` [development, non-minified] 0.0% (0/1), failed. 
error: bundling failed: Error 
    at DependencyGraph._getAbsolutePath (/myProjectPath/node_modules/metro-bundler/src/node-haste/DependencyGraph.js:305:11) 
    at DependencyGraph.getDependencies (/myProjectPath/node_modules/metro-bundler/src/node-haste/DependencyGraph.js:283:4236) 
    at Resolver.getDependencies (/myProjectPath/node_modules/metro-bundler/src/Resolver/index.js:129:5) 
    at /myProjectPath/node_modules/metro-bundler/src/Bundler/index.js:642:39 
    at Generator.next (<anonymous>) 
    at step (/myProjectPath/node_modules/metro-bundler/src/Bundler/index.js:13:1336) 
    at /myProjectPath/node_modules/metro-bundler/src/Bundler/index.js:13:1496 
    at <anonymous> 
    at process._tickCallback (internal/process/next_tick.js:188:7) 

, 나는군요 :이 나를 혼란

The development server returned response error code: 404 

URL: http//10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false 

Body: 

{"message": "Cannot find entry file index.js in any of the roots" 

. Android 에뮬레이터를 사용 중이므로 index.android.js 대신 index.js을 찾는 이유는 무엇입니까?

이 문제를 어떻게 해결할 수 있습니까?

+0

'babel-preset-react-native'의 버전은 무엇입니까? 'package.json'에서 확인할 수 있습니다. –

+0

내 버전은'1.9.1'입니다. – octavian

+0

=>'npm uninstall babel-preset-react-native'를 실행하여 현재'babel-preset-react-native'를 unistalling 해보십시오. 문제를 해결할'2.1.0' 버전을 설치하기 위해'npm install babel-preset-react-native @ 2.1.0'을 실행하십시오. –

답변

0

버전 0.49.1 이후 index.android.js 및 index.ios.js 파일이 하나의 파일로 병합되었습니다. https://github.com/facebook/react-native/issues/16208

이전 버전의 응용 프로그램을 업그레이드해야한다는 점을 알고 있습니다.이 전환은 어려울 것으로 생각됩니다.

관련 문제