让我们先看看错误:
jest-haste-map: Haste module naming collision: @stevemoretz/yoohoo
The following files share their name; please adjust your hasteImpl:
* <rootDir>/.yalc/@stevemoretz/yoohoo-ratchet-expo/.yalc/package-name2/package.json
* <rootDir>/.yalc/package-name1/package.json
Failed to construct transformer: DuplicateError: Duplicated files or mocks. Please check the console for more info
at setModule (/Volumes/HDD/ReactNative/upgrade/store/node_modules/jest-haste-map/build/index.js:543:17)
at workerReply (/Volumes/HDD/ReactNative/upgrade/store/node_modules/jest-haste-map/build/index.js:614:9)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Promise.all (index 27)
at /Volumes/HDD/ReactNative/upgrade/store/node_modules/jest-haste-map/build/index.js:426:22 {
mockPath1: '.yalc/package-name1/.yalc/@stevemoretz/yoohoo/package.json',
mockPath2: '.yalc/package-name2/package.json'
}发生什么事了呢?我在另一个yalc包中使用一个嵌套的yalc包,所以我得到了这个错误,如何解决这个问题?
发布于 2022-01-22 13:13:58
摆脱.yalc文件夹,修复这一点,但我们不能这样做,因为yalc将不能很好地工作。
但是我们可以把它排除在修复它的地铁外,怎么做?https://stackoverflow.com/a/41963217/10268067
因此,在我们的例子中,它变成:
const exclusionList = require("metro-config/src/defaults/exclusionList");
// exclusionList is a function that takes an array of regexes and combines
// them with the default exclusions to return a single regex.
module.exports = {
resolver: {
blacklistRE: exclusionList([/.yalc\/.*/]),
},
};https://stackoverflow.com/questions/70813155
复制相似问题