如何解决在项目中找不到
我在这里挣扎。
我无法从 Github 正确安装 NPM 注册表,所以我决定手动安装这些文件。
我创建了一个名为 /libs 的文件夹,并复制了所有文件并更改了所有导入语句
即来自:
import {ParticipationType} from '@registryName/lib';
到:
import {ParticipationType} from 'views/libs/types';
然后我从 package.json 中删除了包,运行 yarn install
,然后使用 npx react-native run-android
继续运行我的项目,我收到以下错误:
error: bundling failed: Error: Unable to resolve module `views/libs/types` from `views/pages/Dashboard/DashboardView.tsx`: views/libs/types could not be found within the project.
我真的很困惑,因为 ParticipationType 文件存在于 views/libs/types 文件夹中,但它没有在控制台中找到它。
到目前为止我尝试过的事情:
Clear watchman watches: watchman watch-del-all
和
Delete node_modules: rm -rf node_modules and run yarn install
和
Reset Metro's cache: yarn start --reset-cache
欢迎所有帮助
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。