github aquaproj/aqua v2.31.0-1

latest releases: v2.32.0, v2.31.0, v2.31.0-3...
pre-release29 days ago

v2.30.0...v2.31.0-1

Overview

Features:

#2994 Support verifying packages with minisign
#3053 Experimental Support of Node.js

Fixes:

#3012 Replace the word temporal with temporary

Experimental Support of Node.js 🎉

This release includes the experimental support of Node.js.
About the history of Node.js support, please see the following links too.

Node.js support is challenging, and this feature tightly depends on shell such as Bash and Zsh.
We are testing the feature on our laptops and it works fine, but we need your help.
If you're interested in this feature, could you try it out and give your feedback?

Supported environment

  • Shell: Bash and Zsh
    • Other shells such as Fish haven't been supported yet. Your contribution is welcome
  • OS: macOS and Linux
    • Windows hasn't been supported yet. Your contribution is welcome

Set up

  1. Install pre-release versions

This feature hasn't been released officially yet.
So you need to use pre-release versions.

aqua upa v2.31.0-1
registries:
  - type: standard
    ref: v4.215.0-2 # renovate: depName=aquaproj/aqua-registry
packages:
  - name: nodejs/node@v22.6.0
  1. Add scripts to .bashrc or .zshrc

And you need to add scripts to your shell configuration

.bashrc

eval "$(aqua set-shell bash)"

.zshrc

eval "$(aqua set-shell zsh)"

Note that aqua set-shell hasn't been released officially. So aqua v2.31.0-1 is required.

  1. Launch a new shell or reload your shell configuration to reflect the update of shell configuration

Try

  1. Install Node.js
  2. Check versions of Node.js and npm
  3. Install CLI using npm
  4. Run a command installed by npm
  5. Change the version of Node.js
  6. Check versions of Node.js and npm
  7. Install CLI using npm
  8. Run a command installed by npm
aqua i -l
node -v
npm -v
npm i -g zx # Install a command `zx` https://github.com/google/zx
zx -v
aqua up node@v20.16.0 # Change the node version
node -v
npm -v
npm i -g zx
zx -v

How does this feature work?

This is the detail of the feature, so you don't have to read this section necessarily.

npm i -g installs command line tools on the same directory with npm, so aqua needs to add the directory to the environment variable $PATH to allow you to execute those tools.
And the path depends on the version of Node.js, so aqua needs to change $PATH when the version of Node.js is changed.
To do that, you need to configure your shell.
The configuration depends on the type of shells.

In case of Zsh, aqua uses the hook function (add-zsh-hook preexec).
In case of Bash, aqua uses the $PROMPT_COMMAND.
The command aqua set-output outputs the snippet for your shell.
The snippet depends on the type of shells, so you need to specify the shell type.
Supported shell types are bash and zsh.

eval "$(aqua set-shell <shell type>)"

aqua set-shell uses the command aqua output-shell.
aqua output-shell is a hidden command as you don't have to be aware of this command.
aqua output-shell does the following things.

  1. Read all aqua.yaml including global configuration files
  2. Check if each package has the .shell.env.PATH setting

e.g.

        shell:
          env:
            PATH: node-{{.Version}}-{{.OS}}-{{.Arch}}/bin
  1. Restore paths which the previous run of aqua output-shell is outputted and compare them to the current result
  2. Output export PATH=%s to update the environment variable $PATH and save it to a file. If there is no change of $PATH, output nothing

Don't miss a new aqua release

NewReleases is sending notifications on new releases.