2017-01-04 72 views
4

不知道是什麼原因造成了這個問題。今天,當我試圖運行react-native run-android。我得到這個錯誤。有任何想法嗎?(node:53177)UnhandledPromiseRejectionWarning:未處理的承諾拒絕(拒絕ID:2):TypeError:無法讀取未定義的屬性'message'

Starting JS server... 
Running adb -s 3f71ece6 reverse tcp:8081 tcp:8081 
Building and installing the app on the device (cd android && ./gradlew installDebug)... 
Could not install the app on the device, read the error above for details. 
Make sure you have an Android emulator running or a device connected and have 
set up your Android development environment: 
https://facebook.github.io/react-native/docs/android-setup.html 

(node:53177) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: Cannot read property 'message' of undefined 
+0

從我注意到,當我更新nodeJs時,這個錯誤開始出現在我身上。現在我有v7.3.0 – darkyndy

+0

我正在使用節點6.9.2 .. hmmm –

回答

2

我有一個類似的問題,試圖運行在Ubuntu上的Windows上創建的項目。我找到的解決方案是文件project/root/android未被設置爲可執行文件。所以簡單地添加一個chmod +x gradlew爲我解決了這個問題。

+0

這正是它對我來說。我的項目最初是在Windows機器上啓動的,並且在克隆到Mac時發生此錯誤。只有那些神奇的線條之一解決了我認爲需要幾個小時的東西。謝謝! – 1mike12

相關問題