Schniz / fnm

🚀 Fast and simple Node.js version manager, built in Rust
https://fnm.vercel.app
GNU General Public License v3.0
16.46k stars 419 forks source link

How to use in dockerfile ? #1081

Closed seepine closed 2 days ago

seepine commented 6 months ago

dockerfile

FROM mcr.microsoft.com/devcontainers/base:jammy
SHELL ["/bin/bash", "-c"]
WORKDIR /workspaces
RUN curl -fsSL https://fnm.vercel.app/install | bash
RUN fnm install 20.10

The error

...
/bin/bash: line 1: fnm: command not found
...
Schniz commented 6 months ago

Try to use ~/.local/share/fnm/fnm. The install script doesn't link fnm to your /usr/bin so it isn't available without a shell session.