Git Product home page Git Product logo

check-peer-dependencies's Introduction

check-peer-dependencies

Checks peer dependencies of the current NodeJS package. Offers solutions for any that are unmet.

This utility will recursively find all peerDependencies in your project's dependencies list. It checks if you have installed a package that meets the required peer dependency versions. If any peer dependencies are unmet, it will search for a compatible version to install.

Note: you must run npm install or yarn first in order to install all normal dependencies.

usage:

npx check-peer-dependencies [--yarn|--npm] [--install] [--help]

Options:

  -h, --help                       Print usage information             [boolean]
      --version                    Show version number                 [boolean]
      --yarn                       Force yarn package manager          [boolean]
      --npm                        Force npm package manager           [boolean]
      --orderBy                    Order the output by depender or dependee
                         [choices: "depender", "dependee"] [default: "dependee"]
      --debug                      Print debugging information
                                                      [boolean] [default: false]
      --verbose                    Prints every peer dependency, even those that
                                   are met            [boolean] [default: false]
      --ignore                     package name to ignore (may specify multiple)
                                                           [array] [default: []]
      --runOnlyOnRootDependencies  Run tool only on package root dependencies
                                                      [boolean] [default: false]
      --findSolutions              Search for solutions and print package
                                   installation commands
                                                      [boolean] [default: false]
      --install                    Install missing or incorrect peerDependencies
                                                      [boolean] [default: false]

Installing peerDependencies as devDependencies

If a package has a peerDependency that should be installed as a devDependency by, it can list the package name in "peerDevDependencies".
This is not a standard and is only understood by this check-peer-dependencies.

{
  "name": "somepackage",
  "peerDependencies": {
    "react": "16.x",
    "react-dom": "16.x",
    "typescript": "~3.8.0",
    "eslint": "*"
  },
  "peerDevDependencies": ["typescript", "eslint"]
}

Example outputs:

No problems

~/projects/uirouter/sample-app-react master
❯ npx check-peer-dependencies
✅  All peer dependencies are met

Missing peer dependency, solution found

~/projects/uirouter/angular-hybrid master ⇣
❯ npx check-peer-dependencies
❌  @uirouter/[email protected] requires @angular/router ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 (@angular/router is not installed)

Searching for solutions:
yarn add @angular/[email protected]

Incorrect peer dependencies, some solutions found

❯ npx check-peer-dependencies
❌  @uirouter/[email protected] requires @angular/common ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 (9.0.0-next.9 is installed)
❌  @uirouter/[email protected] requires @angular/core ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 (9.0.0-next.9 is installed)
❌  @uirouter/[email protected] requires @angular/router ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 (9.0.0-next.9 is installed)

Searching for solutions:
❌  Unable to find a version of @angular/common that satisfies the following peerDependencies: 9.0.0-next.9 and ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0
❌  Unable to find a version of @angular/core that satisfies the following peerDependencies: 9.0.0-next.9 and ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0

yarn upgrade @angular/[email protected]

check-peer-dependencies's People

Contributors

andresmoschini avatar christopherthielen avatar dependabot[bot] avatar ffluk3 avatar korelstar avatar lencioni avatar raag007 avatar rbnayax avatar regevbr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

check-peer-dependencies's Issues

[Feature request] Support npm `overrides`

At the moment check-peer-dependencies doesn't seem to take the overrides into account.

For example, with this as result

image

I'd expect this override to also get rid of the peer dependency warning

image

Please correct me if I'm wrong, if not I hope this gets considered.

Thanks in advance and thanks for the great script!

Opposite to `--ignore` option

Hey

As far as I understand, --ignore allows to bypass check for some specific packages. I need the opposite - I'd like to check peerDependencies only for limited set of packages (ideally - by regexpt/scope), and I do not care about babel plugins and similar things

Are you open for such PR?

[Docs] Specify which version of npm this is for

Note

This is a docs/readme suggestion to help understand this package better when used in a project

Description of suggestion

Enhancement to the docs suggested, because it would be good to know if check-peer-dependencies is build from the standpoint of npm < 7 or npm 7, 8+. Since npm 7.0 had a major change in the way peer dependencies are treated (they are installed along with subdependencies, whereas in npm 6 and below, one had to add peers in their own project's dependencies).

I'm not sure whether --findSolutions is finding solutions for the npm 6 or npm 7+ lockfile model.

[Feature request] whitelist

Sometimes you have to keep some dependencies unresolved because your project setup does not allow another way f.e.:

  ✅  karma * is required by [email protected] (5.2.3 is installed)
  ✅  karma >=0.9 is required by [email protected] (5.2.3 is installed)
  ✅  karma >=0.9 is required by [email protected] (5.2.3 is installed)
  ✅  karma >=0.9 is required by [email protected] (5.2.3 is installed)
  ❌  tslib ^1.10.0 is required by @angular/[email protected]) (2.0.3 is installed)
  ❌  tslib ^1.10.0 is required by @angular/[email protected]) (2.0.3 is installed)
  ✅  tslib ^2.0.0 is required by [email protected] (2.0.3 is installed)
  ✅  tslint ^6.1.0 is required by @angular-devkit/[email protected] (6.1.3 is installed)
  ✅  tslint ^5.0.0 || ^6.0.0 is required by [email protected] (6.1.3 is installed)
  ❌  tslint ^5.0.0 is required by [email protected]) (6.1.3 is installed)
  ❌  tslint ^5.0.0 is required by @fimbul/[email protected]) (6.1.3 is installed)

Searching for solutions for 4 missing dependencies...

  ❌  Unable to find a version of tslib that satisfies the following peerDependencies: ^1.10.0 and ^2.0.0
  ❌  Unable to find a version of tslint that satisfies the following peerDependencies: ^6.1.0 and ^5.0.0 || ^6.0.0 and ^5.0.0

I would like to whitelist some packages to use this tool to check the rest of our project.

[Feature Request] Ability to filter out dependencies

Within our group, we have a lot of peer dependency issues that we need to resolve, but we want to leverage this tool to block CI jobs that have invalid peer dependency combos. Thus, we would like to filter dependencies that we know are invalid and plan to work on them to "stop the bleeding". Could we add a flag for --ignore?

npx check-peer-dependencies --ignore react,eslint

The above would still return 0 if the only peer dep violations were related to react and eslint

[Feature request] Fail command if peer deps are not met

Hi there, thanks for writing this lib! One thing that would be really helpful is to automate this check on CI, to prevent merges with peer dependencies not met.

There are ways obviously to store the output of this lib and parse the file, but it would be awesome to:

  1. Have some error code to identify when they are not met for easy grep. I think right now the only indicator it is not met is the ❌ at the beginning of the line.
  2. Fail the process with exit code 1 so that we know it failed to verify peer deps are met. This could be an optional flag for backwards compatibility, but it would be very helpful!

Thanks!

[feature] Allow programmatic use that returns an object of data

I'd like to use this within a larger set of CI checks that I currently have in a custom script.

As is I need to spawn this via exec and parse the output, would be great if I could import and call it directly without all the console.logs and get an object back

Unable to resolve terser

Hi @christopherthielen just trying to update uirouter angular hybrid to latest but I'm having problems with this dependency:

$ yarn upgrade [email protected]
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Rebuilding all packages...
success Saved lockfile.
success Saved 2 new dependencies.
info Direct dependencies
└─ [email protected]
info All dependencies
├─ @jridgewell/[email protected]
└─ [email protected]

Found 1 new unmet peerDependencies...
❌ terser ^5.4.0 is required by [email protected]) OPTIONAL (1.0.0 is installed)

Not sure why it thinks 1.0.0 is installed when it's installed 5.30.0 which should be higher than 5.4.0. I'm wondering if there's something amiss with the way it's checking the dependency version?

You can see the failing build here:

ui-router/angular-hybrid#595

Error exit code

It would be nice having an error exit code in order to allow CI tools to take advantage of this tool.

image

Am I missing something?

Unable to find a version

I have got the following error:

16:28:32  #12 108.7   ❌  Unable to find a version of ajv that satisfies the following peerDependencies: ^8.0.0 and ^8.8.2 and ^6.9.1
16:28:32  #12 108.7   ❌  Unable to find a version of mongoose that satisfies the following peerDependencies: ~6.10.0 and ~6.11.0 and *

It seems that ajv and mongoose is already installed, any chance that you can add a new flag that will choose the lowest version of the problematic npm package?

Full output:

16:27:45  #12 61.69 npm WARN exec The following package was not found and will be installed: [email protected]
16:27:48  #12 64.29   ❌  @compodoc/compodoc ^1.1.15 is required by @twittwer/[email protected] (@compodoc/compodoc is not installed)
16:27:48  #12 64.29   ❌  ajv ^8.8.2 is required by [email protected]) (6.12.6 is installed)
16:27:48  #12 64.29   ✅  ajv ^6.9.1 is required by [email protected] (6.12.6 is installed)
16:27:48  #12 64.29   ❌  mongodb-memory-server 8.10.2 is required by @myrepo-core/[email protected] (mongodb-memory-server is not installed)
16:27:48  #12 64.29   ✅  mongoose ~6.10.0 is required by @typegoose/[email protected] (6.10.5 is installed)
16:27:48  #12 64.29   ❌  mongoose ~6.11.0 is required by @typegoose/[email protected]) (6.10.5 is installed)
16:27:48  #12 64.29   ❌  mongoose ~6.11.0 is required by @typegoose/[email protected]) (6.10.5 is installed)
16:27:48  #12 64.29   ✅  mongoose * is required by @nestjs/[email protected] (6.10.5 is installed)
16:27:48  #12 64.29   ❌  passport ^0.4.0 || ^0.5.0 || ^0.6.0 is required by @nestjs/[email protected] (passport is not installed)
16:27:48  #12 64.29 
16:27:48  #12 64.29 Searching for solutions for 6 missing dependencies...
16:27:48  #12 64.29 
16:27:51  #12 67.94   ❌  Unable to find a version of ajv that satisfies the following peerDependencies: ^8.0.0 and ^8.8.2 and ^6.9.1
16:27:51  #12 67.94   ❌  Unable to find a version of mongoose that satisfies the following peerDependencies: ~6.10.0 and ~6.11.0 and *
16:27:51  #12 67.94 
16:27:51  #12 67.94 Installing peerDependencies...
16:27:51  #12 67.94 
16:27:51  #12 67.94 $ yarn add [email protected] [email protected]
16:27:51  #12 68.20 yarn add v1.22.19
16:27:52  #12 68.33 [1/4] Resolving packages...
16:27:53  #12 69.89 [2/4] Fetching packages...
16:27:54  #12 70.94 [3/4] Linking dependencies...
16:27:54  #12 70.95 warning " > @anatine/[email protected]" has unmet peer dependency "openapi3-ts@^2.0.0 || ^3.0.0".
16:27:54  #12 70.95 warning " > @anatine/[email protected]" has unmet peer dependency "[email protected]".
16:27:54  #12 70.95 warning "@anatine/zod-nestjs > @anatine/[email protected]" has unmet peer dependency "openapi3-ts@^2.0.0 || ^3.0.0".
16:27:54  #12 70.95 warning " > @myrepo-core/[email protected]" has unmet peer dependency "is-class@^0.0.9".
16:27:54  #12 70.95 warning "@myrepo-core/elastic-apm-provider > @typegoose/[email protected]" has unmet peer dependency "mongoose@~6.11.0".
16:27:54  #12 70.95 warning " > @nestjs/[email protected]" has unmet peer dependency "axios@^1.3.1".
16:27:54  #12 70.95 warning "@nrwl/cypress > @nrwl/[email protected]" has unmet peer dependency "nx@>= 14.1 <= 16".
16:27:54  #12 70.96 warning "@nrwl/nest > @nrwl/node > @nrwl/webpack > [email protected]" has unmet peer dependency "@babel/core@^7.12.0".
16:27:54  #12 70.96 warning " > @nx-tools/[email protected]" has unmet peer dependency "@nrwl/devkit@^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0".
16:27:54  #12 70.96 warning " > @nx-tools/[email protected]" has unmet peer dependency "dotenv@>=10.0.0".
16:27:54  #12 70.96 warning "@nx-tools/nx-container > @nx-tools/[email protected]" has unmet peer dependency "@nrwl/devkit@^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0".
16:27:54  #12 70.96 warning " > @twittwer/[email protected]" has unmet peer dependency "@compodoc/compodoc@^1.1.15".
16:28:07  #12 81.57 [4/4] Building fresh packages...
16:28:08  #12 85.06 success Saved lockfile.
16:28:08  #12 85.33 success Saved 13 new dependencies.
16:28:09  #12 85.33 info Direct dependencies
16:28:09  #12 85.33 ├─ [email protected]
16:28:09  #12 85.33 └─ [email protected]
16:28:09  #12 85.33 info All dependencies
16:28:09  #12 85.33 ├─ @types/[email protected]
16:28:09  #12 85.33 ├─ [email protected]
16:28:09  #12 85.33 ├─ [email protected]
16:28:09  #12 85.33 ├─ [email protected]
16:28:09  #12 85.33 ├─ [email protected]
16:28:09  #12 85.33 ├─ [email protected]
16:28:09  #12 85.33 ├─ [email protected]
16:28:09  #12 85.33 ├─ [email protected]
16:28:09  #12 85.33 ├─ [email protected]
16:28:09  #12 85.33 ├─ [email protected]
16:28:09  #12 85.33 ├─ [email protected]
16:28:09  #12 85.33 ├─ [email protected]
16:28:09  #12 85.33 └─ [email protected]
16:28:09  #12 85.34 Done in 17.14s.
16:28:09  #12 85.39 
16:28:09  #12 85.39 $ yarn add -D @compodoc/[email protected]
16:28:09  #12 85.66 yarn add v1.22.19
16:28:09  #12 85.78 [1/4] Resolving packages...
16:28:11  #12 87.47 warning @compodoc/compodoc > pdfjs-dist > [email protected]: dommatrix is no longer maintained. Please use @thednp/dommatrix.
16:28:11  #12 87.49 warning @compodoc/compodoc > @angular-devkit/schematics > magic-string > [email protected]: Please use @jridgewell/sourcemap-codec instead
16:28:11  #12 88.04 warning @compodoc/compodoc > pdfmake > @foliojs-fork/pdfkit > @foliojs-fork/fontkit > brfs > static-module > magic-string > [email protected]: Please use @jridgewell/sourcemap-codec instead
16:28:12  #12 88.82 [2/4] Fetching packages...
16:28:12  #12 88.83 warning Pattern ["cors@latest"] is trying to unpack in the same destination "/cache/.npm_cache/v6/npm-cors-2.8.5-eac11da51592dd86b9f06f6e7ac293b3df875d29-integrity/node_modules/cors" as pattern ["[email protected]","cors@~2.8.5"]. This could result in non-deterministic behavior, skipping.
16:28:12  #12 88.83 warning Pattern ["object-assign@latest"] is trying to unpack in the same destination "/cache/.npm_cache/v6/npm-object-assign-4.1.1-2109adc7965887cfc05cbbd442cac8bfbb360863-integrity/node_modules/object-assign" as pattern ["object-assign@^4","object-assign@^4.1.1","object-assign@^4.1.1","object-assign@^4"]. This could result in non-deterministic behavior, skipping.
16:28:12  #12 88.83 warning Pattern ["send@latest"] is trying to unpack in the same destination "/cache/.npm_cache/v6/npm-send-0.18.0-670167cc654b05f5aa4a767f9113bb371bc706be-integrity/node_modules/send" as pattern ["[email protected]","[email protected]"]. This could result in non-deterministic behavior, skipping.
16:28:13  #12 89.96 [3/4] Linking dependencies...
16:28:13  #12 89.96 warning " > @anatine/[email protected]" has unmet peer dependency "openapi3-ts@^2.0.0 || ^3.0.0".
16:28:13  #12 89.96 warning " > @anatine/[email protected]" has unmet peer dependency "[email protected]".
16:28:13  #12 89.96 warning "@anatine/zod-nestjs > @anatine/[email protected]" has unmet peer dependency "openapi3-ts@^2.0.0 || ^3.0.0".
16:28:13  #12 89.96 warning " > @myrepo-core/[email protected]" has unmet peer dependency "is-class@^0.0.9".
16:28:13  #12 89.96 warning " > @nestjs/[email protected]" has unmet peer dependency "axios@^1.3.1".
16:28:13  #12 89.97 warning "@nrwl/cypress > @nrwl/[email protected]" has unmet peer dependency "nx@>= 14.1 <= 16".
16:28:13  #12 89.97 warning "@nrwl/nest > @nrwl/node > @nrwl/webpack > [email protected]" has unmet peer dependency "@babel/core@^7.12.0".
16:28:13  #12 89.98 warning " > @nx-tools/[email protected]" has unmet peer dependency "@nrwl/devkit@^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0".
16:28:13  #12 89.98 warning " > @nx-tools/[email protected]" has unmet peer dependency "dotenv@>=10.0.0".
16:28:13  #12 89.98 warning "@nx-tools/nx-container > @nx-tools/[email protected]" has unmet peer dependency "@nrwl/devkit@^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0".
16:28:28  #12 104.3 [4/4] Building fresh packages...
16:28:28  #12 104.6 success Saved lockfile.
16:28:28  #12 104.9 success Saved 89 new dependencies.
16:28:28  #12 104.9 info Direct dependencies
16:28:28  #12 104.9 └─ @compodoc/[email protected]
16:28:28  #12 104.9 info All dependencies
16:28:28  #12 104.9 ├─ @aduh95/[email protected]
16:28:28  #12 104.9 ├─ @compodoc/[email protected]
16:28:28  #12 104.9 ├─ @compodoc/[email protected]
16:28:28  #12 104.9 ├─ @compodoc/[email protected]
16:28:28  #12 104.9 ├─ @compodoc/[email protected]
16:28:28  #12 104.9 ├─ @foliojs-fork/[email protected]
16:28:28  #12 104.9 ├─ @foliojs-fork/[email protected]
16:28:28  #12 104.9 ├─ @foliojs-fork/[email protected]
16:28:28  #12 104.9 ├─ @ts-morph/[email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 ├─ [email protected]
16:28:28  #12 104.9 └─ [email protected]
16:28:28  #12 104.9 Done in 19.25s.
16:28:28  #12 104.9 
16:28:30  #12 106.1 Found 1 new unmet peerDependencies...
16:28:30  #12 107.3   ❌  ajv ^8.8.2 is required by [email protected]) (6.12.6 is installed)
16:28:30  #12 107.3   ✅  ajv ^6.9.1 is required by [email protected] (6.12.6 is installed)
16:28:30  #12 107.3   ✅  mongoose ~6.10.0 is required by @typegoose/[email protected] (6.10.5 is installed)
16:28:30  #12 107.3   ❌  mongoose ~6.11.0 is required by @typegoose/[email protected]) (6.10.5 is installed)
16:28:30  #12 107.3   ❌  mongoose ~6.11.0 is required by @typegoose/[email protected]) (6.10.5 is installed)
16:28:30  #12 107.3   ✅  mongoose * is required by @nestjs/[email protected] (6.10.5 is installed)
16:28:30  #12 107.3 
16:28:30  #12 107.3 Searching for solutions for 3 missing dependencies...
16:28:30  #12 107.3 
16:28:32  #12 108.7   ❌  Unable to find a version of ajv that satisfies the following peerDependencies: ^8.0.0 and ^8.8.2 and ^6.9.1
16:28:32  #12 108.7   ❌  Unable to find a version of mongoose that satisfies the following peerDependencies: ~6.10.0 and ~6.11.0 and *
16:28:32  #12 108.

Print list of peer dependencies

This is a very helpful tool, thanks!

A nice enhancement would be to provide a new command line argument for printing the whole list of peer dependencies. Since the tool already gathers the list of peer dependencies, I hope the implementation is easy. But it will help when checking an app's package.json for obsolete packages. Output could be human-readable and/or JSON (for using with scripts).

Unable to resolve package fsevents error (While using this tool from Windows)

After installing the latest version of the tool and while running this using a script. We are getting below error. I've gone through the code a little bit and didn't find any argument to send a dependency name to ignore.

Can someone please help with ignoring or any other fix for fsevents or similar dependencies.
As we know that users cannot install fsevents dep in windows servers.

throw new Error("Unable to resolve package " + dependency.name + " from " + packagePath);
                                ^
Error: Unable to resolve package fsevents from C:\Users\v-anvodn\Desktop\MSRepos\test-applications\node_modules\react-scripts
    at walkDependency (C:\Users\v-anvodn\Desktop\MSRepos\test-applications\node_modules\check-peer-dependencies\dist\packageUtils.js:57:11)
    at Array.forEach (<anonymous>)
    at walkPackageDependencyTree (C:\Users\v-anvodn\Desktop\MSRepos\test-applications\node_modules\check-peer-dependencies\dist\packageUtils.js:63:38)
    at walkDependency (C:\Users\v-anvodn\Desktop\MSRepos\test-applications\node_modules\check-peer-dependencies\dist\packageUtils.js:60:4)
    at Array.forEach (<anonymous>)
    at walkPackageDependencyTree (C:\Users\v-anvodn\Desktop\MSRepos\test-applications\node_modules\check-peer-dependencies\dist\packageUtils.js:63:38)
    at Object.gatherPeerDependencies (C:\Users\v-anvodn\Desktop\MSRepos\test-applications\node_modules\check-peer-dependencies\dist\packageUtils.js:23:5)
    at getAllNestedPeerDependencies (C:\Users\v-anvodn\Desktop\MSRepos\test-applications\node_modules\check-peer-dependencies\dist\checkPeerDependencies.js:21:47)    
    at Object.checkPeerDependencies (C:\Users\v-anvodn\Desktop\MSRepos\test-applications\node_modules\check-peer-dependencies\dist\checkPeerDependencies.js:64:37)    
    at Object.<anonymous> (C:\Users\v-anvodn\Desktop\MSRepos\test-applications\node_modules\check-peer-dependencies\dist\cli.js:51:25)

Let me know if you have any questions,
Raag!

Broken?

Ok to proceed? (y) y
/home/nvp/.npm/_npx/25bb3e225fb6eeb9/node_modules/check-peer-dependencies/dist/packageUtils.js:51
                throw new Error("WARN: Unable to resolve package " + dependency.name + " from " + packagePath);
                ^

Error: WARN: Unable to resolve package @ampproject/remapping from /home/nvp/Development/NullVoxPopuli/limber/apps/tutorial/node_modules/@babel/core
    at walkDependency (/home/nvp/.npm/_npx/25bb3e225fb6eeb9/node_modules/check-peer-dependencies/dist/packageUtils.js:51:23)
    at /home/nvp/.npm/_npx/25bb3e225fb6eeb9/node_modules/check-peer-dependencies/dist/packageUtils.js:59:74
    at Array.forEach (<anonymous>)

Method for determining the installed version fails

Hi,
my project depends on a library that uses i18n-http-backend as peerDependency.
Given i18n-http-backend is not installed locally, npx check-peer-dependencies correctly warns about this issue:
❌ i18next-http-backend ^1.2.2 is required by @spartacus/[email protected] (i18next-http-backend is not installed).
However, installing "i18next-http-backend" does not make the error disappear.

The error can be reproduced as follows:

mkdir test
cd test
yarn init
yarn add @spartacus/[email protected]
npx check-peer-dependencies --install --yarn // quits with Recursion limit reached (5)
npx check-peer-dependencies --yarn // this prints the error, but it shouldn't

My guess is that this is due to the folder structure of i18n-http-backend.
resolve.sync reads the following path'node_modules/i18next-http-backend/cjs/package.json'but this file does not contain a version number, therefore getInstalledVersion returns undefined. Which leads to the result that it is assumed that the library is not installed, even if it is present in node_modules.

I am not sure if this is a bug in the i18n library, or if check-peer-dependencies needs to be more flexible here.

Hangs indefinitely

I am editing this ticket because it seems that it has nothing to do with that package. Even when that package has been removed entirely, it still hangs.

npx check-peer-dependencies --yarn --install
npx: installed 44 in 3.597s
// I waited over a minute at this point before I killed the process
^C

If you can add a --debug flag to help determine why it's hanging, I can let you know what it says.

--install installs everything as non-dev dependency

When using check-peer-dependencies --install it properly identifies and installs missing peer dependencies, however peer dependencies of dev-dependencies are not installed as dev-dependencies.

Example:

> npm install --save-dev eslint-config-airbnb on a freshly initialized otherwise empty project complains about missing peer dependencies

Expected behavior

> npx check-peer-dependencies --install installs missing peer dependencies of eslint-config-airbnb as dev-dependencies since it is itself a dev-dependency

Actual behavior

> npx check-peer-dependencies --install installs missing peer dependencies of eslint-config-airbnb as non-dev dependencies

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.