Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
8
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

@neofreko

npm install very slow in container

Doing npm install on a container when building image is notoriously slow. It should be slow because it's on a virtual machine (I was using boot2docker), but it's like heaven and earth when compared to npm install on host machine. Try using npm install --verbose, on host machine you won't be able to read the log because it scrolls so fast. While on a container, you can see it's stopping every now and then -- especially when creating a .cache.json file.

Try this before npm install:

npm config set registry http://registry.npmjs.org/

eg:

# Dockerfile
RUN npm config set registry http://registry.npmjs.org/ && npm install --no-optional --verbose

It works magic for me! :shipit:

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
8
Help us understand the problem. What are the problem?