J
J
Joseph Kopeikin2018-06-06 15:02:27
npm
Joseph Kopeikin, 2018-06-06 15:02:27

Why doesn't npm install work inside a docker container?

Everything works on a local wheelbarrow, on a server one of the containers is not built due to the fact that npm cannot download the necessary packages.
Here is the Dockerfile, build hangs on RUN npm install -g express-generator

# Pull base image from stock node image.
FROM node

# Maintainer
MAINTAINER Robert Schultz <[email protected]>

# Add the current working folder as a mapped folder at /usr/src/app
ADD . /usr/src/app

# Set the current working directory to the new mapped folder.
WORKDIR /usr/src/app

# Install the express generator which gives you also scaffolding tools.
RUN npm install -g express-generator

# Scaffold a new express app using hogan.js and less pre-processor.
RUN express -H -f -c less

# Install your application's dependencies
RUN npm install

# Expose the node.js port to the Docker host.
EXPOSE 3000

# This is the stock express binary to start the app.
CMD [ "bin/www" ]

Having assembled the container without npm install and entering it, I found that the node and npm are up-to-date versions, while when you manually start executing the command on npm install pm2, the installation hangs with the inscription rollbackFailedOptional I ping registry.npmjs.org - there is a ping In the npm config registered registry.npmjs.org, the result has not changed What is the problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question