Skip to content

Commit

Permalink
use nvm in Dockerfile to set the latest npm version
Browse files Browse the repository at this point in the history
  • Loading branch information
trusktr committed Sep 27, 2021
1 parent 98edbfe commit 42d6590
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN apt update && apt-get install -y firefox git wget ros-$ROS_DISTRO-rosbridge-
ARG NODE_VERSION=14
RUN wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash \
&& . $HOME/.nvm/nvm.sh \
&& nvm install $NODE_VERSION && nvm alias default $NODE_VERSION \
&& nvm install $NODE_VERSION --latest-npm && nvm alias default $NODE_VERSION \
&& npm install -g node-gyp

RUN echo "source /opt/ros/$ROS_DISTRO/setup.bash" >> $HOME/.bashrc
Expand Down
9 changes: 3 additions & 6 deletions test/build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,10 @@ set -e

pushd "$(dirname "$0")" > /dev/null

echo -e "\e[1m\e[35mUPDATE NPM ------------------------------\e[0m"
echo old version:
echo -e "\e[1m\e[35mnode version:\e[0m"
node -v
echo -e "\e[1m\e[35mnpm version:\e[0m"
npm -v
npm i -g npm
echo new version:
npm -v
echo -e "\e[1m\e[35m-----------------------------------------\e[0m"

echo -e "\e[1m\e[35mnpm install\e[0m"
# TODO remove this --legacy-peer-deps flag @babel/eslint-parser is updated to officially support eslint >=8
Expand Down

0 comments on commit 42d6590

Please sign in to comment.