执行react-native start时报错



  • Error building DependencyGraph:
    TypeError: Cannot read property 'root' of null
    at index.js:16:84
    at tryCallOne (/Users/kuntian/projects/private/android/callintent/node_modules/react-native/node_modules/promise/lib/core.js:37:12)
    at /Users/kuntian/projects/private/android/callintent/node_modules/react-native/node_modules/promise/lib/core.js:103:15
    at flush (/Users/kuntian/projects/private/android/callintent/node_modules/react-native/node_modules/promise/node_modules/asap/raw.js:50:29)
    at doNTCallback0 (node.js:419:9)
    at process._tickCallback (node.js:348:13)



  • 更多信息:

    Looking for JS files in
    /Users/kuntian/projects/private/android/callintent

    [19:23:31] <START> Building Dependency Graph
    [19:23:31] <START> Crawling File System
    [19:23:31] <START> Loading bundles layout
    [19:23:31] <END> Loading bundles layout (0ms)

    React packager ready.

    Error building DependencyGraph:
    TypeError: Cannot read property 'root' of null
    at index.js:16:84
    at tryCallOne (/Users/kuntian/projects/private/android/callintent/node_modules/react-native/node_modules/promise/lib/core.js:37:12)
    at /Users/kuntian/projects/private/android/callintent/node_modules/react-native/node_modules/promise/lib/core.js:103:15
    at flush (/Users/kuntian/projects/private/android/callintent/node_modules/react-native/node_modules/promise/node_modules/asap/raw.js:50:29)
    at doNTCallback0 (node.js:419:9)
    at process._tickCallback (node.js:348:13)
    EBJ1446:callintent kuntian$



  • @KennyTian 说:

    TypeError: Cannot read property 'root' of null

    这个错误一般是node_modules安装不全。删掉node_modules目录后重新npm install试试。