【发布时间】:2016-06-10 02:29:32
【问题描述】:
我第一次尝试让 React Native 运行他们的 hello world 应用程序 (AwesomeProject),但我在控制台中收到此错误:
Failed to build DependencyGraph: Cannot read property 'root' of null
TypeError: Cannot read property 'root' of null
at index.js:16:60
at tryCallOne (/Users/Eduardo/Documents/Code/Personal/ReactNative/AwesomeProject/node_modules/promise/lib/core.js:37:12)
at /Users/Eduardo/Documents/Code/Personal/ReactNative/AwesomeProject/node_modules/promise/lib/core.js:123:15
at flush (/Users/Eduardo/Documents/Code/Personal/ReactNative/AwesomeProject/node_modules/asap/raw.js:50:29)
at _combinedTickCallback (node.js:370:9)
at process._tickCallback (node.js:401:11)
~
Process terminated. Press <enter> to close the window
首先,我是一名移动开发人员(原生 ios 和 android),并且我了解 node。
我关注了 React Native 的 Getting Started 页面,安装了带有 npm install 和 npm install -g 的 npm
当我尝试使用node server 单独启动节点服务器时,我得到了这个:
$ node server
module.js:341
throw err;
^
Error: Cannot find module '/Users/Eduardo/Documents/Code/Personal /ReactNative/AwesomeProject/server'
at Function.Module._resolveFilename (module.js:339:15)
at Function.Module._load (module.js:290:25)
at Function.Module.runMain (module.js:447:10)
at startup (node.js:141:18)
at node.js:933:3`
这是我在 iOS 模拟器和尝试运行应用程序时的控制台中获得的屏幕截图:
值得一提的是,我在带有 Xcode 7.2 的 Mac OS 10.10.5 上运行它,NativeScript 创建了一个没有问题的简单应用程序。
对此有何建议?
我目前只想了解一下 React Native。 谢谢!
【问题讨论】:
-
试试
brew uninstall watchman和brew install watchman -
嘿,成功了!想让它成为答案,以便我可以将其记录为已解决?
标签: ios node.js npm react-native