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'
本文介绍了如何解决React Native项目中遇到的无法解析模块导入路径的问题,并提供了详细的步骤来修复错误,包括清除缓存、删除并重新安装node_modules以及重置打包器缓存。
3467

被折叠的 条评论
为什么被折叠?



