React Native 错误 Module does not exist in the module map

前端之家收集整理的这篇文章主要介绍了React Native 错误 Module does not exist in the module map前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
bundling Failed: "Unable to resolve module `login` from `/Users/zhangdi/work/rn/zhtxcs/app/pages/App.js`: Module does not exist in the module map\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`."

错误说是找不到路径

import Login from 'login'
import Index from 'index'

导入自己写的js一定不要忘了写‘./’,否则会以为引入的是modules。。。。

改成:

import Login from './login'
import Index from './index'
原文链接:https://www.f2er.com/react/302764.html

猜你在找的React相关文章