Error: jest-haste-map: @providesModule naming collision when using a local dependency

前端 未结 5 1365
旧时难觅i
旧时难觅i 2021-01-13 07:50

I\'m using a local module in package.json that also has react-native as a dependency.

In my APP package.json:

         


        
相关标签:
5条回答
  • 2021-01-13 08:20

    I also got the same error. I tried below steps, its works like a charming.

    Please remove all react-native specific folders from "%appdata%\Temp" and then try below commands:

    rimraf node_modules
    npm cache clean --force
    npm install
    rm -rf ios/build
    

    Change /Users/Jebasuthan/XcodeProject/Game/ios/Pods/React/package.json to something else

    non recursive

    0 讨论(0)
  • 2021-01-13 08:21

    Faced same issue Resolved it !!

    All the npm packages in project have node modules. Make sure that node_modules directory inside packages should not include already present node module.

    In my case react-native was present in node_modules of my project as well as node_modules of another forked library.

    As the library was forked, I could remove node_modules directory from it and the issue got resolved.

    0 讨论(0)
  • 2021-01-13 08:21
    const blacklist = require('metro-config/src/defaults/blacklist');
    module.exports = {
     resolver: {
        blacklistRE: blacklist([
            /node_modules\/.*\/node_modules\/react-native\/.*/,
        ])
     },
    };
    
    0 讨论(0)
  • 2021-01-13 08:22
    watchman watch-del-all
    
    rm -rf node_modules && npm install
    
    rm -fr $TMPDIR/react-*
    npm cache clean
    npm start -- --reset-cache
    

    for more check out here

    0 讨论(0)
  • 2021-01-13 08:36

    I respond myself.

    As a temporary solution, and given putting the dependencies in peerDependencies didn't work either, I've put the react and react-native in devDependencies of the react-native-services package.

    0 讨论(0)
提交回复
热议问题