Error encountered in React Native packager due to naming conflict between "lodash" and "yeoman-generator" libraries

Issue Description

Within my current project, I am utilizing "react-native": "0.36.0" along with the following dependencies:

  • "lodash": "^4.15.0"
  • "yeoman-generator": "^0.24.1"

Upon using versions above "^3.10.1" for "lodash" and "0.21.2" for "yeoman-generator", there were conflicts in names like "lodash", "inquirer", and "cli-width" when running packager.

Steps to Reproduce

To replicate this issue, ensure you have the mentioned dependencies and execute: react-native start --reset-cache

Expected Result:

jest-haste-map: @providesModule naming collision:
Duplicate module name: inquirer
  Paths: /CoolProject/node_modules/react-native/node_modules/yeoman-generator/node_modules/inquirer/package.json collides with /CoolProject/node_modules/react-native/node_modules/inquirer/package.json
...
This warning is caused by a @providesModule declaration with the same name across two different files.

Possible Solutions

One possible workaround is to maintain the same versions of "lodash" and "yeoman-generator" as indicated in the

<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0f7d6a6e6c7b22616e7b66796a">[email protected]</a>
(i.e. "^3.10.1" for "lodash" and "0.21.2" for "yeoman-generator"). However, modifying these versions may not be feasible at the moment due to dependency relationships. Are there any alternative solutions available?

Thank you!

Updates

For further information regarding this issue, refer to the GitHub issue I filed under the react-native repository: https://github.com/facebook/react-native/issues/11200

Additional Update

After upgrading react-native to version 0.39, the problem was resolved. The fix seems to involve removing the seemingly redundant (and potentially outdated) yeoman-generator dependency: https://github.com/facebook/react-native/commit/1fd7a574ba538d05da4be841c84a70766464ec13

Answer №1

When transitioning from using npm to yarn for module installation or setting up projects in React Native, you may encounter this issue. Simply running a npm install can often resolve the problem without causing any harm to your project's setup.

Running npm install will alert you if any of your modules are deprecated or configured with a different version than those required by React Native, and it will take the necessary steps to address these issues. Additionally, pay attention to any npm WARN gentlyRm warnings indicating packages that have been set aside but not removed if you want to thoroughly clean up your configuration.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

I have the ability to utilize local storage within NextJS with the integration of redux-thunk

Issue with using local Storage in file Store.js An error occurred during page generation. Any console logs will be displayed in the terminal window. In Store.js import { createStore, combineReducers, applyMiddleware } from "redux"; import thunk from " ...

Encountered a permission denied error while trying to run `npm install`: Error: EACCES

As I attempt to run npm install for a react application on Windows 10 using VS Code with Git Bash, I encounter an issue. Surprisingly, the process works smoothly on WSL2 Ubuntu in VS Code, but when I try to use Git Bash, the server reloading takes more tha ...

Convert JavaScript code to Google Appscript

Looking for guidance on incorporating Javascript code into my Google Appscript. Here is the code snippet: I have a separate Stylesheet.html file saved. Can someone advise me on how to invoke the functions within the html file? <script> //google. ...

What is the best method for inserting a URL link using jQuery within a CSS element?

Check out this code snippet: <span class='maincaptionsmall'> Test </span> Due to certain ajax and jquery scripts on my page, I am unable to use HREF as a link. In other words, the following code won't work: <span class=&ap ...

Is it possible to reveal a concealed element or modify the functionality of a hyperlink?

I have a link in the navigation that includes an animated icon of a + turning into an x. When the icon is in the x state, I want users to be able to close it by clicking on the icon or text. However, I am unsure of the best way to approach this. One op ...

How to implement form modal binding using Laravel and Vue.js

There are two models named Tour.php public function Itinerary() { return $this->hasMany('App\Itinerary', 'tour_id'); } and Itinerary.php public function tour() { return $this->belongsTo('App\Tour', ...

Retrieving values from all fields in a dynamic form using VuejsLet's say

In the process of developing an admin panel using Vuejs and tailwind CSS for managing exercises on a page, I have encountered some challenges. My current objective is to insert the dynamic form values into a Firebase real-time database. However, I am stru ...

What is the best way to execute a function based on its name, which is provided as a parameter

Is there a better way to call a function by its name, passed as a parameter in JavaScript? Here's my scenario: I have a switch case where I need to set the data for an API ajax call. Once the ajax call is complete, I want to call a specific print func ...

Header on top of table that stays in place with scrolling

I'm facing an issue with a table that contains user-generated data. We are utilizing a plugin known as Clusterize, which allows us to smoothly scroll through large amounts of rows. However, the specific markup required for this plugin seems to be caus ...

Automatically switch slides and pause the carousel after completing a loop using Bootstrap 5 Carousel

Seeking assistance with customizing the carousel functionality. There seems to be some issues, and I could use a hand in resolving them. Desired Carousel Functionality: Automatically start playing the carousel on page load, and once it reaches the end of ...

A more efficient method for tallying values within an object (JavaScript, React)

Is there a more efficient way to determine the count of items with a specific key/value pair in a React state? When the list is large, this method may become a bottleneck. To illustrate the question, consider the following simplified example: class App ...

What is the best way to execute a JavaScript function using Python Selenium?

Is it possible to repeatedly call the MapITRFtoWgs84() function with input from a text file and save the output to another text file? I believe Selenium might be the right tool for this task. Could you provide guidance on how to achieve this? Attached is ...

Encountering difficulties in creating an app with Apache Cordova

After setting up the proxy settings, I attempted to create a new app named "hello" using Cordova with the following commands: npm config set proxy http://proxy.company.com:8080 npm config set https-proxy http://proxy.company.com:8080 The creation comman ...

Exchange selection choices among harvested selected boxes

In my project, I am working on swapping all the options between two select boxes. The specific scenario I am dealing with involves recording details of phone calls. These calls can either be inbound or outbound. For outbound calls, I have a 'caller&ap ...

Guide on transferring object between two $states using ui-router

Visit this link for more information Expected Behavior Upon logging in, selecting a Ticker button is expected to trigger the display of matching Tags for that specific Ticker. Actual Results However, upon clicking a Ticker button after logging in, the ...

Looking for reliable resources on establishing a connection between a Google account and my application

I am currently working on creating a react native app that aims to simplify the user login process by allowing them to link their Google account with just one click. This way, users won't have to constantly log in every time they use the app. While I ...

Tips for finding the correct file path for a .js file when utilizing the require function

I am currently working on an ExpressJS project and I am facing an issue with using a .js module inside another. Despite using require to retrieve the .js module, it appears that the path is incorrect which is preventing me from locating the module. How can ...

Looking to resolve an issue that is arising in the antd tree component

Having trouble with the antd tree component - when searching and checking/unchecking a field, all previously selected data is unchecked. I want to only update the field that is currently being changed. Not sure how to fix this issue, any help would be appr ...

The parameters for Vue.js @change events are consistently returning as 0 whenever a file is uploaded by clicking on the picture

Check out my JSFiddle here:: https://jsfiddle.net/includephone/o9gpb1q8 I've encountered an issue involving the @change event on an input field. My goal is to create a carousel of images with 4 images per slide. Data Object Structure data: functio ...

Best return type for a webservice triggered using jQuery but not requiring any data to be returned

I am currently working on a web service that utilizes several methods. These methods do not have significant impact on the client side as I call them using jQuery/ajax. My main concern is regarding the recommended return type. Typically, I would return JS ...