-
Notifications
You must be signed in to change notification settings - Fork 146
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
Support for .nvmrc
latest release version
#295
Comments
Unfortunately, support for this feature is not in the hands of this plugin. The main logic, as you can see, is inside node-build, which is also the cause of the error message Of course, there is a feature request in the node-build repo for this, but it's been open since over a year, so I wouldn't expect too much there. Another solution would be from the asdf-side. asdf could get a list of all available versions, choose the latest one, and then forward the exact version number to the plugin. There's a feature request for this, too. Either solution seems fine. |
A workaround for that, based on this article: https://jasonraimondi.com/posts/fix-binary-not-found-error-asdf-nodejs-v14-with-m1-mac/
|
@aquelehugo Oh my, that's a fix! Even better, create symlinks! ln -s 14.18.0 14
ln -s 16.13.0 16
ln -s 17.8.0 17 Don't even have to reshim this way, all |
This change will make it such that when installing a version like so: `asdf install nodejs 16.10` It would install 16.10.3, assuming 16.10.3 is the latest point release at the time of installation. This change allows asdf to work better with legacy version specifiers such as what would be stored in `.nvmrc`. For this to work properly, it would also (in the example above), symlink 16.10 to point to 16.10.3 (and likewise to link 16 to 16.10.3). Such symlinks are expected to point to the latest version installed that satisfies the partial version number. An uninstallation script has to be added so that symlinks aren't left dangling at any point. This fix addresses issue asdf-vm#295.
We changed the way aliases work on #348, now you need to explicitly opt-in with dynamic ranges on legacy version files ( To enable it, you need to provide an export ASDF_NODEJS_LEGACY_FILE_DYNAMIC_STRATEGY=latest_installed
# OR
export ASDF_NODEJS_LEGACY_FILE_DYNAMIC_STRATEGY=latest_available Please update the plugin by running I would also advise removing old symlinks made manually, as they can cause other issues, a quick script for removing them would be to run: for inst in "${ASDF_DATA_DIR:-$ASDF_DIR}/installs/nodejs"*; do
if [ -L "$inst" ]; then
rm "$inst"
fi
done |
When using nvm, a valid
.nvmrc
file isWhich means default to the latest node 14 release. Docs here: https://github.com/nvm-sh/nvm#nvmrc
However, when using asdf-nodejs with this
.nvmrc
and thelegacy_version_file = yes
configuration, the correct version of nodes is not selected:While I have the latest nodejs 14 version installed,
14.19.1
, it's not selected. It would be nice for compatibility if it was.The text was updated successfully, but these errors were encountered: