2017-04-09 40 views
1

enter image description here我得到下面的錯誤我收到「無法解析模塊`反應

開發服務器返回的響應錯誤代碼:500

URL: http://10.0.2.2:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false 

Body: 
{"from":"D:\AwesomeProject\index.android.js","to":"react","message":"Unable to resolve module react from D:\\AwesomeProject\\index.android.js: Module does not exist in the module map or in these directories:\n D:\AwesomeProject\node_modules\n\nThis might be related to https://github.com/facebook/react-native/issues/4968\nTo resolve try the following:\n 1. Clear watchman watches: watchman watch-del-all.\n 2. Delete the node_modules folder: rm -rf node_modules && npm install.\n 3. Reset packager cache: rm -fr $TMPDIR/react-* or npm start --reset-cache.","name":"UnableToResolveError","type":"UnableToResolveError","errors":[{}]} 
onResponse 
DevServerHelper.java:332 
execute 
RealCall.java:126 
run 
NamedRunnable.java:32 
runWorker 
ThreadPoolExecutor.java:1112 
run 
ThreadPoolExecutor.java:587 
run 
Thread.java:818 

{"from":":\\AwesomeProject\\index.android.js","to":"react","message":"Unable to resolve module `react` 
i tried every workaround given by the log still it's not working.. 
+0

可我看見你的index.android.js? – Codesingh

回答

0

有與節點模塊一個問題,我必須remove the node moduleadd然後我不得不降級React-Native庫並運行命令react-native start,然後react-native run-android後它爲我工作

0

檢查是否命名反應的文件夾內部存在node_modules命名的文件夾或沒有,如果它不存在的話,

安裝後停止服務器,並重新安裝「反應」

npm install react --save 

請正在重置的重新啓動服務器緩存

npm start --reset-cache 

然後運行你的應用程序

相關問題