0

添加后react-native-push-notification@react-native-community/push-notification-ios我面临错误:

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,清除了守望者并重新运行

没有任何帮助。

"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",
4

1 回答 1

0

我确实将黑名单添加到metro.config.js NOTrn-cli.config.js

// metro.config.js
var blacklist = require('metro-config/src/defaults/blacklist');

module.exports = {
    resolver: {
        blacklistRE: blacklist([
            /node_modules\/.*\/node_modules\/react-native\/.*/,
        ])
    },
};
于 2020-06-08T07:40:01.703 回答