Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

280
Vistas
npm ci in Dockerfile throws 401 not authorized when using node:16 as base image

For some reason, NPM requires authentication when running npm ci in a docker build. I never had this issue before. What is happening?

This is my Dockerfile:

FROM node:16 as builder
WORKDIR /app
COPY package*.json ./
RUN npm ci

This is the error I am receiving:

 > [4/4] RUN npm ci:
#8 1.357 npm notice 
#8 1.357 npm notice New minor version of npm available! 7.21.1 -> 7.23.0
#8 1.357 npm notice Changelog: <https://github.com/npm/cli/releases/tag/v7.23.0>
#8 1.357 npm notice Run `npm install -g npm@7.23.0` to update!
#8 1.357 npm notice 
#8 1.358 npm ERR! code E401
#8 1.359 npm ERR! Unable to authenticate, your authentication token seems to be invalid.
#8 1.359 npm ERR! To correct this please trying logging in again with:
#8 1.359 npm ERR!     npm login
#8 1.370 
#8 1.370 npm ERR! A complete log of this run can be found in:
#8 1.370 npm ERR!     /root/.npm/_logs/2021-09-11T11_55_11_040Z-debug.log

This is my package.json:

{
  "name": "warranty-ui",
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "serve": "vite preview"
  },
  "devDependencies": {
    "@sveltejs/vite-plugin-svelte": "^1.0.0-next.11",
    "sass": "^1.39.2",
    "svelte": "^3.37.0",
    "vite": "^2.5.4"
  },
  "dependencies": {
    "bulma": "^0.9.3",
    "i18next": "^20.6.1",
    "msal": "^1.4.12"
  }
}

Edit: I found out that when using node:14 as base image. The error doesn't come.

FROM node:14 as builder

This works for me, but probably not for everyone.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda