Installing node 14 on centos 7, how does it work?
1
vote
1
answer
5610
views
The code for installing node 14 on centos7 is:
RUN curl -sL https://rpm.nodesource.com/setup_14.x | bash -
RUN yum -y install nodejs
How does it work? The first command downloads the package. Where does it get stored? How does the second command install nodejs from the downloaded package? Thanks.
What is the difference between putting
bash
and bash -
**UPDATE:**
If someone came to this question searching for installing node in centos7, here is a code snippet that gets the exact version from NodeJS website.
RUN wget https://nodejs.org/download/release/v14.17.0/node-v14.17.0-linux-x64.tar.gz && \
tar xf node-v14.17.0-linux-x64.tar.gz -C /opt/ && \
rm node-v14.17.0-linux-x64.tar.gz
ENV PATH=/opt/node-v14.17.0-linux-x64/bin:$PATH
RUN npm config set cache /tmp --global
Asked by vijayst
(111 rep)
Apr 21, 2022, 05:07 PM
Last activity: Apr 22, 2025, 05:02 PM
Last activity: Apr 22, 2025, 05:02 PM