React-Native:错误:ENOENT:没有这样的文件或目录,打开'MainApplication.java'

时间:2016-08-30 02:43:56

标签: react-native

我在React Native项目目录中运行react-native link

运行时我收到错误:

Error: ENOENT: no such file or directory, open '/Users/**********/f8app/android/app/src/main/java/com/facebook/f8/MainApplication.java'

但是,此文件确实存在。

完整输出:

(@):f8app *************$ react-native link
{ Error: Cannot find module '/Users/************/f8app/node_modules/moment/package.json'
    at Function.Module._resolveFilename (module.js:455:15)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at getRNPMConfig (/Users/***********/f8app/node_modules/react-native/local-cli/rnpm/core/src/config/index.js:13:10)
    at Object.getDependencyConfig (/Users/************/f8app/node_modules/react-native/local-cli/rnpm/core/src/config/index.js:38:14)
    at /Users/**************/f8app/node_modules/react-native/local-cli/rnpm/link/src/getDependencyConfig.js:11:24
    at Array.reduce (native)
    at getDependencyConfig (/Users/***********/f8app/node_modules/react-native/local-cli/rnpm/link/src/getDependencyConfig.js:8:15)
    at link (/Users/***********/f8app/node_modules/react-native/local-cli/rnpm/link/src/link.js:114:22) code: 'MODULE_NOT_FOUND' }
? What is your CodePush deployment key for Android (hit <ENTER> to ignore) 
rnpm-link info Linking react-native-code-push android dependency 
rnpm-link ERR! It seems something went wrong while linking. Error: ENOENT: no such file or directory, open '/Users/***********/f8app/android/app/src/main/java/com/facebook/f8/MainApplication.java' 
Please file an issue here: https://github.com/rnpm/rnpm/issues 
/Users/*****************/f8app/node_modules/react-native/node_modules/promise/lib/done.js:10
      throw err;
      ^

Error: ENOENT: no such file or directory, open '/Users/**********/f8app/android/app/src/main/java/com/facebook/f8/MainApplication.java'
    at Error (native)
    at Object.fs.openSync (fs.js:640:18)
    at Object.fs.readFileSync (fs.js:508:33)
    at applyPatch (/Users/***********/f8app/node_modules/react-native/local-cli/rnpm/link/src/android/patches/applyPatch.js:6:29)
    at registerNativeAndroidModule (/Users/**********/f8app/node_modules/react-native/local-cli/rnpm/link/src/android/registerNativeModule.js:23:3)
    at /Users/***********/f8app/node_modules/react-native/local-cli/rnpm/link/src/link.js:55:5
    at process._tickCallback (internal/process/next_tick.js:103:7) 

0 个答案:

没有答案