question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Description: Support using https://github.com/nodejs/corepack to manage non-NPM package managers.

Ideally in between installing node and bootstrapping the package manager cache, this action:

  • enables corepack (could be a no-op depending on the node version)
  • caches/restores the corepack root
  • runs corepack prepare --active

(after some research, that last one may not necessary but instead makes an implicit step explicit)

This behavior could either be trigged by the presence of the packageManager field in the root package.json (might be suprising), cache: 'auto' as possibly envisioned in #306, or corepack: true

Justification: Both pnpm and yarn support corepack, and yarn recommendeds corepack for package manager versioning. Currently using corepack with this action will break when using the cache key as this action assumes the appropriate version manager has already been installed. However, you don’t necessarily want to bootstrap with corepack until the appropriate node version has been installed and configured.

Related: #530 #182

Are you willing to submit a PR? Yes

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:32
  • Comments:21 (5 by maintainers)

github_iconTop GitHub Comments

10reactions
wmertenscommented, Oct 21, 2022

@tisonkun you’re not even using setup-node…

Ideally, setup-node optionally supports corepack, since Node optionally supports it. For example:

- uses: actions/setup-node@v4
  with:
    node-version: 16
    corepack: true
    cache: true
    install: true

This would install Node 16, run corepack enable, read the packageManager field, set up the cache for that, and then call the package manager in the correct way for CI (npm ci, pnpm i etc).

10reactions
linghengqiancommented, Sep 9, 2022
  • I am surprised that this is actually an issue, corepack is still in the experimental stage and of course needs to be manually enabled. I myself have been using corepack enable && corepack prepare pnpm@7.11.0 --activate.

  • This issue should actually be closed and wait for nodejs to enable corepack by default.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Corepack | Node.js v19.3.0 Documentation
Corepack is an experimental tool to help with managing versions of your package managers. It exposes binary proxies for each supported package manager...
Read more >
nodejs/corepack: Zero-runtime-dependency package ... - GitHub
Corepack is a zero-runtime-dependency Node.js script that acts as a bridge ... When running Corepack within projects that don't list a supported package ......
Read more >
Support - mscrm-addons.com
Not found the answer to your question? You can reach our support team 17/5 via e-mail, phone, chat or by creating a support...
Read more >
corepack - npm
Start using corepack in your project by running `npm i corepack`. There are 6 other projects in the npm registry using corepack.
Read more >
Corepack: the Node.js' manager of package managers
Remember that for now Corepack v0.9.0 only supports pnpm , npm and yarn . Basic usage. We can use the same package manager...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found