首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >jest-react map:重复模块名称:react动画

jest-react map:重复模块名称:react动画
EN

Stack Overflow用户
提问于 2020-06-08 07:26:10
回答 1查看 316关注 0票数 0

在添加react-native-push-notification@react-native-community/push-notification-ios之后,我将面临以下错误:

代码语言:javascript
复制
Error: jest-haste-map: Haste module naming collision:
  Duplicate module name: react-animated
  Paths: /<projectPath>/node_modules/@react-native-community/push-notification-ios/node_modules/react-native/Libraries/Animated/release/package.json collides with /<projectPath>/node_modules/react-native/Libraries/Animated/release/package.json

This error is caused by `hasteImpl` returning the same name for different files.
    at setModule (/<projectPath>/node_modules/jest-haste-map/build/index.js:569:17)
    at workerReply (/<projectPath>/node_modules/jest-haste-map/build/index.js:641:9)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Promise.all (index 77)
  • 我对添加黑名单做了rn-cli.config.js
  • 清除纱线缓存,删除node_modules,清除看守人员并重新运行

没人帮上忙。

代码语言:javascript
复制
"react": "16.8.3",
"react-native": "0.59.10",
"@react-native-community/push-notification-ios": "^1.2.0",
"react-native-push-notification": "^3.5.2",
EN

回答 1

Stack Overflow用户

发布于 2020-06-08 07:40:01

我确实把黑名单添加到了metro.config.js而不是rn-cli.config.js

代码语言:javascript
复制
// metro.config.js
var blacklist = require('metro-config/src/defaults/blacklist');

module.exports = {
    resolver: {
        blacklistRE: blacklist([
            /node_modules\/.*\/node_modules\/react-native\/.*/,
        ])
    },
};
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62256998

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档