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

ERR_PNPM_INCLUDED_DEPS_CONFLICT occurs only when pnpm astro add xxx #8550

Closed
1 task
PorcoRosso85 opened this issue Sep 13, 2023 · 1 comment
Closed
1 task
Labels
needs triage Issue needs to be triaged

Comments

@PorcoRosso85
Copy link

PorcoRosso85 commented Sep 13, 2023

Astro Info

user@g6i3:~/pjs/examples/pnpm_comflict/packages/der$ pnpm astro info
Astro                    v3.0.13
Node                     v18.17.1
System                   Linux (x64)
Package Manager          pnpm
Output                   static
Adapter                  none
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

under the env by pnpm monorepo

Describe the Bug

why I ask because

  • pnpm astro add xxx is not working under the each package
  • pnpm workspace maybe has no rational of conflict, please refer reproducing repo of bottom
  • other astro xxx command is working
  • and other all pnpm command is also working
  • I want to know why only pnpm astro add xxx cannot work

output for error

user@g6i3:~/pjs/examples/pnpm_comflict/packages/der$ pnpm astro add react
✔ Resolving packages...

  Astro will run the following command:
  If you skip this step, you can always run it yourself later

 ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────╮
 │ pnpm add @astrojs/react @types/react-dom@^18.0.6 @types/react@^18.0.21 react-dom@^18.0.0 react@^18.0.0  │
 ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯

✔ Continue? … yes
✖ Installing dependencies...

  ERR_PNPM_INCLUDED_DEPS_CONFLICT  modules directory (at "/home/user/pjs/examples/pnpm_comflict") was installed with optionalDependencies, dependencies, devDependencies. Current install wants optionalDependencies, dependencies.

 error   Astro could not update your astro.config.js file safely.
  Reason: Unable to install dependencies

  You will need to add these integration(s) manually.
  Documentation: https://docs.astro.build/en/guides/integrations-guide/
  File:
    /home/user/pjs/examples/pnpm_comflict/node_modules/.pnpm/[email protected]/node_modules/astro/dist/cli/add/index.js:169:31
  Code:
    168 |     case 3 /* failure */: {
    > 169 |       throw createPrettyError(new Error(`Unable to install dependencies`));
          |                               ^
      170 |     }
      171 |   }
      172 |   const rawConfigPath = await resolveConfigPath({
  Stacktrace:
Error: Astro could not update your astro.config.js file safely.
Reason: Unable to install dependencies

You will need to add these integration(s) manually.
Documentation: https://docs.astro.build/en/guides/integrations-guide/
    at add (file:///home/user/pjs/examples/pnpm_comflict/node_modules/.pnpm/[email protected]/node_modules/astro/dist/cli/add/index.js:169:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async runCommand (file:///home/user/pjs/examples/pnpm_comflict/node_modules/.pnpm/[email protected]/node_modules/astro/dist/cli/index.js:102:7)
    at async cli (file:///home/user/pjs/examples/pnpm_comflict/node_modules/.pnpm/[email protected]/node_modules/astro/dist/cli/index.js:144:5)

reproducing

https://github.com/PorcoRosso85/pnpm_comflict
sorry for using devbox env,

What's the expected result?

pnpm astro add xxx will go well in each package under ./packages

Link to Minimal Reproducible Example

https://stackblitz.com/github/PorcoRosso85/pnpm_comflict

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Sep 13, 2023
@PorcoRosso85 PorcoRosso85 changed the title ERR_PNPM_INCLUDED_DEPS_CONFLICT  modules directory (at "/home/user/pjs/examples/pnpm_comflict") was installed with optionalDependencies, dependencies, devDependencies. Current install wants optionalDependencies, dependencies. ERR_PNPM_INCLUDED_DEPS_CONFLICT occurs only when pnpm astro add xxx Sep 13, 2023
@Princesseuh
Copy link
Member

Princesseuh commented Sep 14, 2023

Duplicate of #8487

@Princesseuh Princesseuh marked this as a duplicate of #8550 Sep 14, 2023
@Princesseuh Princesseuh marked this as a duplicate of #8487 Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants