2017-11-11 4 views
2

index.jsエントリファイルが見つかりません:ここでは404エラーは、私はこのエラーを取得してい

The development server returned response 404. Cannot find entry file index.js.

enter image description here

は私のフォルダ構造です:

enter image description here

package.json

{ 
    "name": "vepo", 
    "version": "0.0.1", 
    "private": true, 
    "scripts": { 
    "start": "node node_modules/react-native/local-cli/cli.js start", 
    "test": "jest" 
    }, 
    "rnpm": { 
    "assets": [ 
     "./app/fonts" 
    ] 
    }, 
    "jest": { 
    "preset": "react-native", 
    "moduleNameMapper": { 
     "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js", 
     "\\.(css|less)$": "<rootDir>/__mocks__/styleMock.js" 
    } 
    }, 
    "dependencies": { 
    "flow-typed": "^2.0.0", 
    "generator-rn-toolbox": "^2.2.0", 
    "imagemagick": "^0.1.3", 
    "immutable": "^3.8.1", 
    "native-base": "2.3.0", 
    "prop-types": "^15.5.10", 
    "react": "16.0.0", 
    "react-native": "0.50.3", 
    "react-native-aws3": "^0.0.8", 
    "react-native-blur": "^3.1.3", 
    "react-native-communications": "^2.2.1", 
    "react-native-drawer": "^2.3.0", 
    //"react-native-fbsdk": "git://github.com/facebook/react-native-fbsdk#065507aa1d2b8b0b6cb50d13117694123f8303fa", 
    "react-native-git-upgrade": "^0.2.7", 
    "react-native-image-picker": "^0.26.4", 
    "react-native-interactable": "^0.1.2", 
    "react-native-mail": "^3.0.2", 
    "react-native-maps": "^0.16.4", 
    "react-native-modal": "^2.3.2", 
    "react-native-modalbox": "^1.3.9", 
    "react-native-multiple-choice": "^0.0.8", 
    "react-native-navigation": "^1.1.100", 
    "react-native-off-canvas-menu": "^0.1.31", 
    "react-native-optimized-flatlist": "^1.0.1", 
    "react-native-redux-router": "^1.0.7", 
    "react-native-select-multiple": "^1.0.3", 
    "react-native-side-menu": "^0.20.1", 
    "react-native-vector-icons": "^4.4.0", 
    "react-navigation": "^1.0.0-beta.11", 
    "react-redux": "^5.0.3", 
    "redux": "^3.6.0", 
    "redux-immutable": "^4.0.0", 
    "redux-observable": "^0.14.1", 
    "reselect": "^3.0.0", 
    "rxjs": "^5.2.0", 
    "yoga": "^0.0.0" 
    }, 
    "devDependencies": { 
    "babel-eslint": "^7.1.1", 
    "babel-jest": "19.0.0", 
    "babel-plugin-module-resolver": "^2.7.0", 
    "babel-preset-react-native": "3.0.1", 
    "eslint": "^3.17.0", 
    "eslint-plugin-flowtype": "^2.30.3", 
    "eslint-plugin-jsx": "^0.0.2", 
    "eslint-plugin-react": "^6.10.0", 
    "eslint-plugin-react-native": "^2.3.1", 
    "flow-bin": "^0.42.0", 
    "jest": "19.0.2", 
    "jest-cli": "^19.0.2", 
    "react-test-renderer": "~15.4.1", 
    "redux-devtools": "^3.3.2", 
    "remote-redux-devtools": "^0.5.7" 
    } 
} 

エラーが発生する原因は何ですか?

+0

最近RNを更新しましたか? – SNT

+0

index.jsファイルの場所が間違っています。 RN 49の後にindex.android.jsとindex.ios.jsは必要ありません。そのうちの1つを削除して、他の名前をindex.jsに変更してください。 – SNT

答えて

8

プロジェクトのルートディレクトリにindex.jsファイルを作成し、index.android.jsまたはindex.ios.jsをコピーします。

デフォルトではRN 49以降、iosとAndroidのエントリは異なります。アンドロイドとiosの両方が使用するindex.jsファイルが1つしかありません。

+0

私の現在のindex.ios.jsは です 'import {AppRegistry} from '反応するネイティブ ' ' ./src 'から{App}をインポートする //GLOBAL.XMLHttpRequest = GLOBAL.originalXMLHttpRequest || GLOBAL.XMLHttpRequest AppRegistry.registerComponent( 'vepo'、()=> App) ' これはまったく変更する必要がありますか? – BeniaminoBaggins

+0

これらのファイルはもう必要ありません。 index.ios.jsからindex.jsに名前を変更し、index.android.jsを削除してください – SNT

+0

ありがとう、私はこれを解決策としてマークします。私はそれを行うときに[このエラー](https://stackoverflow.com/q/47235645/3935156)を取得しています。しかしおそらく無関係です。 – BeniaminoBaggins

関連する問題