Skip to content

Commit cb15115

Browse files
authored
install nvm and default to node 20
1 parent 3f5efe3 commit cb15115

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
11
FROM --platform=linux/amd64 node:lts-bookworm-slim
22
SHELL ["/bin/bash", "-c"]
3+
4+
ENV NVM_DIR=/root/.nvm
5+
ENV NODE_VERSION=20.18.1
6+
37
RUN apt update && apt install -y curl bash git tar gzip libc++-dev jq
8+
9+
# Install nvm, node and npm
10+
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash \
11+
&& . "$NVM_DIR/nvm.sh" \
12+
&& nvm install ${NODE_VERSION} \
13+
&& nvm use ${NODE_VERSION} \
14+
&& nvm alias default ${NODE_VERSION}
15+
16+
# Add node and npm to path
17+
ENV PATH="${NVM_DIR}/versions/node/v${NODE_VERSION}/bin:${PATH}"

0 commit comments

Comments
 (0)