How to Install Node JS on Docker



This blog gives brief commands on how to installation NodeJS on a CentOS Docker image. The detailed instructions of putting in NodeJS on Linux may be observed on this page. Please feel free to comment/advise if I failed to mention one or more vital points

Following is the set of commands:


  • Install Docker for your machine.
  • Pull the CentOS Docker image.
  • Create a container with the use of the CentOS docker image. Use the subsequent command

docker run -ti -DP --name centos -v /c/Users:/mnt/Users centos:latest /bin/bash
  • Start the Docker container and attach the image. Use the following command

# Starts the docker container
docker start centos
# Attach
docker attach centos

  • Use the following command to install NodeJS:

# Run as root on RHEL, CentOS, CloudLinux or Fedora:
curl -sL https://rpm.nodesource.com/setup | bash -
# Install as Root
yum install -y nodejs
And this is it. Once the set up is done, type “npm” and you have to find “npm” usage command commands.

Read more Nodejs Online Training 
Running apt-get installation node does now not installation Node.Js because it's not the bundle you are asking for.

If you run apt-cache info node you may see that what you are putting in is an "Amateur Packet Radio Node program (transitional bundle)"

You should follow the Node.Js install instructions to put in via package deal manager.

Or if you want to build from git, you can just try this inside Docker:
RUN apt-get install git-core curl build-essential openssl libssl-dev \
 && git clone https://github.com/nodejs/node.git \
 && cd node \
 && ./configure \
 && make \
 && sudo make install
If you want to learn node JS, then Getting Started with Nodejs Certification is an excellent course to start with.

Comments

Popular posts from this blog

Informatica Knowledge Base (IKB)

Learn About React Vs. Angular: Which one is easier

MicroStrategy Vs Tableau: 11 Thing You're Forgetting to Do