Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] peerDependency not installed (workspaces) #4084

Open
2 tasks done
kirrg001 opened this issue Nov 23, 2021 · 5 comments
Open
2 tasks done

[BUG] peerDependency not installed (workspaces) #4084

kirrg001 opened this issue Nov 23, 2021 · 5 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release

Comments

@kirrg001
Copy link

kirrg001 commented Nov 23, 2021

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

Refs #2600

I am using NPM workspaces.
I moved all my dev dependencies to the root package.json (because I was running into #4056)

devDependencies: {
   ...
   "mssql": "^7.1.0",
   "knex": "^0.21.21",
   ....
}

knex@0.21 has a peerDependency to mssql@6 (see)

I am getting an error when running npm install

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @projectname/root@undefined
npm ERR! Found: mssql@7.1.0
npm ERR! node_modules/mssql
npm ERR!   dev mssql@"^7.1.0" from the root project
npm ERR!   peerOptional mssql@"*" from typeorm@0.2.41
npm ERR!   node_modules/typeorm
npm ERR!     dev typeorm@"^0.2.37" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev knex@"^0.21.21" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: mssql@7.3.0
npm ERR! node_modules/mssql
npm ERR!   peerOptional mssql@"^6.2.1" from knex@0.21.21
npm ERR!   node_modules/knex
npm ERR!     dev knex@"^0.21.21" from the root project

I tried --legacy--peer-deps, but this is not what I want. This flag will just ignore the peer dependency. Knex will then use mssql@7!

Expected Behavior

I expected that npm provides a way to install both versions.

node_modules
    mssql@7
    knex
        node_modules
            mssql@6

Steps To Reproduce

See above.

Environment

  • npm: 8.1.4
  • Node: v16.13.0
  • OS: Monterey
  • platform: OSX
@kirrg001 kirrg001 added Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release labels Nov 23, 2021
@ghost
Copy link

ghost commented Nov 26, 2021

Facing similar issue. We are using knex and objection. In our case, some of the direct dependencies are not installed as well in workspaces. Works fine when these packages are installed in the root.

@ghost
Copy link

ghost commented Dec 15, 2021

Facing similar issue. We are using knex and objection. In our case, some of the direct dependencies are not installed as well in workspaces. Works fine when these packages are installed in the root.

this happens if node_modules directories are in the workspace directories. a fresh installation without lockfile and node_modules directory. the issue doesn't happen.

@oswaldoacauan
Copy link

We still see the same issue when having different Next and React versions in two different workspaces.

Same deal as mentioned above. If we run the npm install inside the workspace folder it works as expected.

@easa
Copy link

easa commented Jun 7, 2022

I guess it's not a bug yet there is no instruction about how to handle this conflicts. I couldn't find anything in the docs and I would be grateful if you could explain what this error means in workspaces and what we need to do to fix it.

@danielritter
Copy link

same problem here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release
Projects
None yet
Development

No branches or pull requests

4 participants