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

CLI: using pnpm causes multiple npm list errors written to CLI output for provider, synth and debug commands #2903

Closed
1 task done
jamestelfer opened this issue May 31, 2023 · 5 comments · Fixed by #2959
Closed
1 task done
Labels
bug Something isn't working help wanted Community contributions welcome as the core team is unlikely to work on this soon priority/backlog Low priority (though possibly still important). Unlikely to be worked on within the next 6 months. size/medium estimated < 1 week

Comments

@jamestelfer
Copy link
Contributor

jamestelfer commented May 31, 2023

Expected Behavior

When the cdktf-cli package is installed as a dev dependency via pnpm, no npm errors are written to the output.

Actual Behavior

When running some commands (provider get, debug, synth, multiple errors are written of the following form:

[2023-05-31T23:22:01.376] [ERROR] default - npm
npm[2023-05-31T23:22:01.377] [ERROR] default -  ERR! code ELSPROBLEMS
npm ERR! invalid: [email protected] /Users/[user]/src/[project]/ops/node_modules/constructs

 ERR! code ELSPROBLEMS
npm ERR! invalid: [email protected] /Users/[user]/src/[project]/ops/node_modules/constructs
[2023-05-31T23:22:01.377] [ERROR] default -
npm ERR! A complete log of this run can be found in:
npm

npm ERR! A complete log of this run can be found in:
npm[2023-05-31T23:22:01.378] [ERROR] default -  ERR!     /Users/[user]/.npm/_logs/2023-05-31T13_21_59_841Z-debug-0.log

 ERR!     /Users/[user]/.npm/_logs/2023-05-31T13_21_59_841Z-debug-0.log

I'm uncertain if this is causing an issue or not: the command ends up succeeding.

Steps to Reproduce

  1. Create a typescript CDKTF project
  2. Convert to the pnpm package manager (pnpm import yarn.lock or pnpm import package-lock.json)
  3. pnpm add cdktf-cli@latest
  4. Run pnpm install
  5. Run pnpm exec cdktf provider get or pnpm exec cdktf debug

Versions

> [project][email protected] cdktf /Users/[user]/src/[project]/ops
> cdktf "debug"

[2023-05-31T23:18:21.003] [ERROR] default - npm
npm[2023-05-31T23:18:21.004] [ERROR] default -  ERR! code ELSPROBLEMS
npm ERR! invalid: [email protected] /Users/[user]/src/[project]/ops/node_modules/.pnpm/node_modules/jsii

 ERR! code ELSPROBLEMS
npm ERR! invalid: [email protected] /Users/[user]/src/[project]/ops/node_modules/.pnpm/node_modules/jsii
[2023-05-31T23:18:21.005] [ERROR] default -


[2023-05-31T23:18:21.005] [ERROR] default - npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/[user]/.npm/_logs/2023-05-31T13_18_19_473Z-debug-0.log

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/[user]/.npm/_logs/2023-05-31T13_18_19_473Z-debug-0.log
[2023-05-31T23:18:21.006] [ERROR] default - npm
npm[2023-05-31T23:18:21.006] [ERROR] default -  ERR! code ELSPROBLEMS

 ERR! code ELSPROBLEMS
[2023-05-31T23:18:21.007] [ERROR] default - npm ERR!
npm ERR![2023-05-31T23:18:21.007] [ERROR] default -  invalid: [email protected] /Users/[user]/src/[project]/ops/node_modules/constructs

 invalid: [email protected] /Users/[user]/src/[project]/ops/node_modules/constructs
[2023-05-31T23:18:21.008] [ERROR] default -


[2023-05-31T23:18:21.008] [ERROR] default - npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/[user]/.npm/_logs/2023-05-31T13_18_19_473Z-debug-0.log

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/[user]/.npm/_logs/2023-05-31T13_18_19_473Z-debug-0.log
cdktf debug
language: typescript
cdktf-cli: 0.16.1
node: v18.16.0
cdktf: 0.16.1
constructs: null
jsii: null
terraform: 1.4.6
arch: arm64
os: darwin 22.4.0

Providers

┌───────────────┬──────────────────┬─────────┬────────────┬─────────────────────┬─────────────────┐
│ Provider Name │ Provider Version │ CDKTF   │ Constraint │ Package Name        │ Package Version │
├───────────────┼──────────────────┼─────────┼────────────┼─────────────────────┼─────────────────┤
│ aws           │ 4.66.1           │ ^0.16.0 │            │ @cdktf/provider-aws │ 14.0.4          │
└───────────────┴──────────────────┴─────────┴────────────┴─────────────────────┴─────────────────┘

Gist

https://gist.github.com/jamestelfer/03f844d1e1dc83df2c7d79730545a7a3

Workarounds

I haven't seen this with a globally installed CLI, but I'm not 100% certain why.

We don't install the CLI globally as we want the local development environment consistent with CI, and we have multiple projects that don't necessarily change CLI versions at the same time.

Anything Else?

The command being run (npm list jsii --json or similar) works with pnpm: pnpm list jsii --json. I haven't checked the JSON output.

If pnpm was run if a pnpm-lock.yaml is detected, this would avoid the error.

I don't know what the effect of this error is.

I'm willing to have a look at a fix, but I'm unsure of the timeline that I'd have to contribute it -- I might be able to get someone on my team to have a look.

References

No response

Help Wanted

  • I'm interested in contributing a fix myself

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@jamestelfer jamestelfer added bug Something isn't working new Un-triaged issue labels May 31, 2023
@jamestelfer jamestelfer changed the title COMPONENT: short issue description CLI: using pnpm causes multiple npm list errors written to CLI output for provider, synth and debug commands May 31, 2023
@DanielMSchmidt DanielMSchmidt added needs-priority Issue has not yet been prioritized; this will prompt team review size/medium estimated < 1 week and removed new Un-triaged issue labels Jun 2, 2023
@DanielMSchmidt
Copy link
Contributor

DanielMSchmidt commented Jun 2, 2023

We don't have support for pnpm (we have never tested with it and it does not work), please use npm or yarn if possible. Leaving this ticket open to bring pnpm support, but most likely this will need to happen through a community PR

@xiehan xiehan added help wanted Community contributions welcome as the core team is unlikely to work on this soon priority/backlog Low priority (though possibly still important). Unlikely to be worked on within the next 6 months. and removed needs-priority Issue has not yet been prioritized; this will prompt team review labels Jun 2, 2023
@jamestelfer
Copy link
Contributor Author

Would a pull request supporting pnpm list as described above be accepted? Not official support, just not obviously failing?

FWIW, pnpm has been working well aside from this seemingly non functional output.

@DanielMSchmidt
Copy link
Contributor

Sure, as long as it wouldn't fall for users without pnpm installed we are happy to review the PR 👍

@jamestelfer
Copy link
Contributor Author

Sorry to bother on this -- I understand that this is a low priority issue. Is there anything else I need to do to make the PR (#2959) ready for review?

@github-actions
Copy link
Contributor

github-actions bot commented Aug 5, 2023

I'm going to lock this issue because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Community contributions welcome as the core team is unlikely to work on this soon priority/backlog Low priority (though possibly still important). Unlikely to be worked on within the next 6 months. size/medium estimated < 1 week
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants