Questions tagged [peer-dependencies]

99 questions
34
votes
2 answers

How to test an npm module with peerDependencies?

I am new to understand peerDependencies, and I have read the following references seeking as to how to test an npm module contains peerDependencies within its package.json: Peer Dependencies Understanding the npm dependency model Common npm…
Jeff
  • 1,917
  • 1
  • 25
  • 43
34
votes
3 answers

Missing peer dependencies

I am new to npm and angular projects, and I am using bootstrap@4.1.1 in my package.json. When I do npm install, I get the following error - bootstrap@4.1.1 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer…
dev27
  • 605
  • 1
  • 7
  • 15
12
votes
3 answers

How do I identify which npm packages are just peer dependencies?

I'm trying to remove unused packages from the package.json files for a few projects but I'm running into issues with peer dependencies. There are some tools, such as depcheck, which try to list all of the "unused" packages, but it doesn't…
12
votes
2 answers

Using Peer Dependencies With Local (file:../some-lib) Dependencies

I have a monorepo that has many micro-services in it. There are some library-type functions / classes that I want to make available to any micro-service that needs it. However, if that library package declares a peer dependency, the peer dependency…
Jeremy Thomerson
  • 722
  • 2
  • 8
  • 19
9
votes
2 answers

Ignore peer dependency check for single package in package.json

I try to exclude the package react-virtualized from the peer dependency checking of NPM 7. I know I could separately install that package with npm install react-virtualized --legacy-peer-deps ...but my goal is to install all packages with npm…
user3601578
  • 1,310
  • 1
  • 18
  • 29
8
votes
2 answers

package.json override dependencies peer dependencies

When running npm i in one of my projects I get the follow error: npm ERR! Found: react@17.0.2 npm ERR! node_modules/react npm ERR! react@"^17.0.2" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer…
Luïs
  • 2,671
  • 1
  • 20
  • 33
8
votes
3 answers

How to list all required npm peerDependencies

How can I list out all currently required peer dependencies in my project? I've tried searching, but I only find a bunch of custom packages to check peer dependencies. I already know they're currently ok, but I want a list of what packages and…
Svish
  • 152,914
  • 173
  • 462
  • 620
8
votes
2 answers

ngrx/store@6.1.0 requires a peer of @angular/core@^6.0.0 while upgrading to angular 7

I tried to migrate Angular 6 application to angular 7 application and have got the following warning messsage npm WARN @ngrx/effects@6.1.0 requires a peer of @angular/core@^6.0.0 but none is installed. You must install peer dependencies…
Tom
  • 8,175
  • 41
  • 136
  • 267
7
votes
0 answers

Should a peer dependency be added in both peerDependencies and dependencies in package.json?

I have a library that uses npm packages that I want as peer dependencies where the app would have to install them (eg. axios, react, react-dom). The goal is to avoid having libraries add to overall bundle size of the app. Should I add these only…
Tim Hysniu
  • 1,446
  • 13
  • 24
7
votes
4 answers

NPM: npm peer dependency conflict

I download a project and it has no package-lock.json file.When I run npm install , there is conflict. The error message: root@fb3391c63c7f:/app/avatar/avatar-h5# npm install --registry=https://registry.npm.taobao.org npm ERR! code ERESOLVE npm ERR!…
sheldon_66
  • 83
  • 1
  • 1
  • 6
6
votes
3 answers

How to make optional peer dependencies truly optional

I have an NPM package that offers two things: Core functionality in form of React hooks and UI components that use these core functionalities. My idea originally was to make two packages, one for the core stuff and one for the components. So that if…
David Fariña
  • 1,536
  • 1
  • 18
  • 28
6
votes
1 answer

Is there a way to tell lerna/npm to 'really look in my own node_modules for those peer dependencies'?

I have a fairly standard lerna monorepo that will look like this: packages/ main/ - This is the main deployable application, it depends on both dep and react-dep dep/ - Just some pure functions, no problems here react-dep/ - A design…
dwjohnston
  • 11,163
  • 32
  • 99
  • 194
5
votes
1 answer

How do I resolve peer dependency conflicts with Nx, Angular and Nest?

I have a pretty fresh Nx workspace. Created an Angular app and a Nest app a few months ago, no problems. I come back after a hiatus to start a new Angular app and now I have a bunch of peer dependency conflicts I don't know how to resolve. I've…
5
votes
2 answers

Npm Including all range of pre-release when defining peer-dependency

I am maintaining an NPM package (lets say it as package-A) that relies on an another NPM package(package-B) to function. Therefore, I am in need to add that package as peer-dependency into the package.json, so that npm and the user can be sure that…
buriedalive
  • 380
  • 5
  • 12
5
votes
0 answers

Yarn workspaces shared dependencies

I'm trying to build a project that uses yarn workspaces. And here's what I want to accomplish in my setup: > root > packages > client package.json - graphql > server package.json - graphql …
1
2 3 4 5 6 7