Skip to content

Commit 55b530d

Browse files
committed
fix node version
1 parent cec4e6d commit 55b530d

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

.devcontainer/Dockerfile

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ARG DEBIAN_FRONTEND=noninteractive
1010

1111
ARG SOLANA_CLI="1.16.27"
1212
ARG ANCHOR_CLI="0.29.0"
13-
ARG NODE_VERSION="20.18.x"
13+
ARG NODE_VERSION="20.18.1"
1414

1515
# Create a non-root user
1616
ARG USERNAME=vscode
@@ -31,7 +31,7 @@ ENV PATH="${HOME}/.local/share/solana/install/active_release/bin:${PATH}"
3131
# Install base utilities.
3232
RUN mkdir -p /workdir && mkdir -p /tmp && \
3333
apt-get update -qq && apt-get upgrade -qq && apt-get install -qq \
34-
build-essential git curl wget jq pkg-config python3-pip \
34+
build-essential git curl wget jq pkg-config python3-pip xz-utils \
3535
libssl-dev libudev-dev
3636

3737
# libssl1.1 is not needed for newer versions
@@ -41,12 +41,14 @@ RUN curl "https://sh.rustup.rs" -sfo rustup.sh && \
4141
sh rustup.sh -y && \
4242
rustup component add rustfmt clippy
4343

44-
# Install node / npm / yarn.
45-
RUN apt-get install -y nodejs npm && \
46-
npm install -g yarn && \
47-
npm install -g ts-mocha && \
48-
npm install -g typescript && \
49-
npm install -g mocha
44+
# Install node / npm / yarn (pinned)
45+
RUN curl -fsSLO https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz && \
46+
tar -xJf node-v${NODE_VERSION}-linux-x64.tar.xz -C /usr/local --strip-components=1 && \
47+
rm node-v${NODE_VERSION}-linux-x64.tar.xz && \
48+
corepack enable && \
49+
npm install -g ts-mocha typescript mocha yarn
50+
51+
RUN node -v && npm -v
5052

5153
# Install Solana tools (x86_64 version).
5254
RUN curl -sSfL https://github.com/solana-labs/solana/releases/download/v${SOLANA_CLI}/solana-release-x86_64-unknown-linux-gnu.tar.bz2 | tar -xjC /tmp && \

0 commit comments

Comments
 (0)