Skip to content

Instantly share code, notes, and snippets.

@jagdishlove
Created February 24, 2023 18:59
Show Gist options
  • Save jagdishlove/e22e97e5ab2db02281451e282074a475 to your computer and use it in GitHub Desktop.
Save jagdishlove/e22e97e5ab2db02281451e282074a475 to your computer and use it in GitHub Desktop.
Setting npm config set legacy-peer-deps true on the Git main branch will not affect other team members' local npm configurations. Each team member will still need to run the command on their local machines if they want to use the --legacy-peer-deps option.
However, you can create a .npmrc file and add it to the Git repository to share the legacy-peer-deps configuration setting with other team members. Here's how to do it:
Create a new file called .npmrc in the root directory of your Git repository.
Add the following line to the file:
javascript
Copy code
legacy-peer-deps=true
Save the file and commit it to the Git repository.
Now, when other team members clone the repository, they will automatically have the legacy-peer-deps option set to true in their npm configuration, and they won't need to run the npm config set command themselves.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment