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

Yarn: error due to bn not being declared as a dependency #84

Closed
drewgingerich opened this issue Nov 18, 2024 · 4 comments
Closed

Yarn: error due to bn not being declared as a dependency #84

drewgingerich opened this issue Nov 18, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@drewgingerich
Copy link

drewgingerich commented Nov 18, 2024

I have a project using Yarn PnP and I get the following error when trying to run the renovate CLI via the npm package:

Error: @renovatebot/kbpgp tried to access bn, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

This error appears to indicate that bn should be declared as a dependency, rather than how it's currently declared as a devDependency. I'm not sure what the intended setup is, so maybe a peerDependency could be more appropriate, too.

Yarn PnP is extremely strict, so it tends to uncover configuration errors that silently work in other setups.

My package.json is as follows, with a few fields redacted:

{
  "scripts": {
    "renovate": "RENOVATE_LOG_FILE=renovate.log RENOVATE_CONFIG_FILE=renovate-config.js renovate",
  },
  "dependencies": {
    "renovate": "^39.20.1",
    "uuid": "^11.0.2",
    "zod": "^3.23.8"
  },
  "devDependencies": {
    "@types/node": "^22.0.0",
    "typescript": "^5.6.3"
  },
  "packageManager": "[email protected]"
}

My yarnrc.yml is as follows:

compressionLevel: mixed

enableGlobalCache: false

supportedArchitectures:
  os:
    - darwin
    - linux
  cpu:
    - x64
    - arm64

yarnPath: .yarn/releases/yarn-4.5.1.cjs
@drewgingerich drewgingerich changed the title Yarn: error due to bn not declared in dependencies Yarn: error due to bn not being declared as a dependency Nov 18, 2024
@viceice
Copy link
Member

viceice commented Nov 19, 2024

🤔 8e69856 is the cause.

It seem bn is used somewhere in code beside tests. will investigate

@viceice viceice self-assigned this Nov 19, 2024
@viceice viceice added the bug Something isn't working label Nov 19, 2024
@viceice
Copy link
Member

viceice commented Nov 19, 2024

fixed in 4299fcb

@viceice viceice closed this as completed Nov 19, 2024
viceice added a commit that referenced this issue Nov 19, 2024
@viceice
Copy link
Member

viceice commented Nov 19, 2024

@drewgingerich
Copy link
Author

Thanks, that was so fast!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants