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

docs: Update core.md with clear explanation on reshim #1787

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion docs/manage/core.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,21 @@ A helper command to print the OS, Shell and `asdf` debug information. Share this
asdf reshim <name> <version>
```

This recreates the shims for the current version of a package. By default, shims are created by plugins during installation of a tool. Some tools like the [npm CLI](https://docs.npmjs.com/cli/) allow global installation of executables, for example, installing [Yarn](https://yarnpkg.com/) via `npm install -g yarn`. Since this executable was not installed via the plugin lifecycle, no shim exists for it yet. `asdf reshim nodejs <version>` will force recalculation of shims for any new executables, like `yarn`, for `<version>` of `nodejs` .
This recreates the shims for the current version of a package. By default, shims are created by `asdf` plugins during the installation of a tool. However, when using package managers like `yarn` or `pnpm` to globally install executables (for example, installing [serve](https://github.com/vercel/serve) via `yarn add global serve`), these packages are not installed during the asdf plugin lifecycle. As a result, shims for these executables are not automatically created.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem with this (and the existing text) is that asdf is a generic version manager. Not everyone using asdf will know what yarn and npm are, as they don't use Node.JS. I understand the behavior may be confusing to newcomers, but I'm think the references to Node.JS package managers may make this more confusing for most new users.

Copy link
Author

@HwangTaehyun HwangTaehyun Oct 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the review! Yes, I agree! But as you know, the original example explanation for reshim was about node and npm, and it was not accurate, so I edited this part to make it clearer.

Also, in order to explain reshim, there should be a case where the asdf plugin lifecycle and other package managers exist, but I can't think of any except this case. Do you have any other good examples?


For example, after installing serve globally with yarn:

```shell
yarn add global serve
```
You may notice that the serve command is not immediately available in your terminal. This is because the executable was installed outside of the `asdf` plugin lifecycle, so no shim exists for it.

To ensure `asdf` recognizes the new serve executable, run:

```shell
asdf reshim nodejs <version>
```
This will force the recalculation of shims for any new globally installed executables, like serve, which were installed by a package manager like `yarn` or `pnpm`, outside of `asdf` plugin lifecycle, for the specified `<version>` of `nodejs`.

## Shim-versions

Expand Down