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

ghost dependencies (compatibility with pnpm linker) #2621

Closed
3 tasks done
turadg opened this issue Dec 9, 2024 · 2 comments
Closed
3 tasks done

ghost dependencies (compatibility with pnpm linker) #2621

turadg opened this issue Dec 9, 2024 · 2 comments

Comments

@turadg
Copy link

turadg commented Dec 9, 2024

Prerequisites

  • Are you running the latest version(s)? "@subql/cli": "^5.3.3"
  • Have you searched the documentation for your issue?
  • Did you search for an existing issue or pull request?

Description

When using the Yarn nodeLinker: pnpm, the yarn dev command fails with,

Error: Cannot find module 'chalk'
Require stack:
- /opt/agoric/agoric-subql/node_modules/.store/@subql-cli-npm-5.3.3-f97be50ff8/package/bin/run

It looks like this is because the run module/script requires chalk but the package.json doesn't declare it. I.e. a ghost dependency

Details

Steps to Reproduce

  1. `echo "nodeLinker: pnpm" > .yarnrc.yml
  2. yarn install
  3. yarn dev

Expected behavior: [What you expected to happen]

run runs

Actual behavior: [What actually happened]

Error: Cannot find module 'chalk'
Require stack:
- /opt/agoric/agoric-subql/node_modules/.store/@subql-cli-npm-5.3.3-f97be50ff8/package/bin/run

I tried patching it up with this in .yarnrc.yml,

packageExtensions: {
  "@subql/cli@*": {
    dependencies: {
      chalk: "^4.0.0",
    },
  },
  "@subql/common@*": {
    dependencies: {
      "form-data": "^4.0.0"
    },
  },
}

but there was yet another and I don't know how many ghosts there are.

Any other information

A good way to find ghosts is to change the repo's nodeLinker to pnpm. You might also adopt Corepack for specifying the packageManger.

@stwiname
Copy link
Collaborator

I've added the missing deps in this PR, there is more work required to support other package managers

#2622

@turadg
Copy link
Author

turadg commented Dec 17, 2024

@stwiname this was closed "as completed" but as you point out, more work is required.

The title says “compatibility with pnpm linker” and the repo is still failing.

Mind reopening until the project is compatible with the pnpm linker?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants