You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install 20 2>&1":
0.987 Version '20' not found - try `nvm ls-remote` to browse available versions.
------
failed to solve: process "/bin/sh -c su vscode -c \"source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1\"" did not complete successfully: exit code: 3
In the same time, when I'm installing the same node's version locally, not from the Docker, it's done successfully.
Could anybody help me, please?
The text was updated successfully, but these errors were encountered:
The issue you're encountering is likely due to the nvm environment not being fully initialized when running the su vscode -c command. Here's an updated version of your Dockerfile:
ARG RUBY_VERSION=3.3
ARG DISTRO_NAME=bullseye
FROM mcr.microsoft.com/devcontainers/ruby:1-$RUBY_VERSION-$DISTRO_NAME
ARG NODE_VERSION="20"
# Ensure nvm is properly sourced and initialized
RUN su vscode -c "export NVM_DIR="/usr/local/share/nvm" && \
. /usr/local/share/nvm/nvm.sh && \
nvm install ${NODE_VERSION} && \
nvm use ${NODE_VERSION} && \
nvm alias default ${NODE_VERSION}"
Hello!
I'm using the following Dockerfile:
And when I'm building the image, it crashes with
In the same time, when I'm installing the same node's version locally, not from the Docker, it's done successfully.
Could anybody help me, please?
The text was updated successfully, but these errors were encountered: