-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds review for next stepsneeds review for next steps
Description
Is there an existing issue for this?
- I have searched the existing issues
This issue exists in the latest npm version
- I am using the latest npm
Current Behavior
I have an Angular project that I am deploying to Azure using Dockerfile. Everything worked fine up until last week, and then npm starting failing with 'Exit handler never called!'. I have researched this extensively over the weekend and tried clearing cache, package-lock.json, changing to http instead https registry.
I am running Ubuntu 22 on an Amazon Workspace. I keep getting EAI_AGAIN errors from multiple packages and retries fail to fix the issue.
My dockerfile is :
#############################
# 1️⃣ Base image for building
#############################
FROM node:23-alpine AS base
RUN npm install -g @angular/cli
# Set the working directory
WORKDIR /app
# Build args
ARG PROJECT=""
ARG BUILDCMD="build"
# Copy package.json and package-lock.json files
COPY package.json package-lock.json ./
RUN --mount=type=cache,target=/root/.npm npm install --legacy-peer-deps --force --verbose
# Copy all files
COPY . .
# Build the application
RUN npm run ${BUILDCMD} -- ${PROJECT}
##################################
# 2️⃣ Final image: Serve with Nginx
##################################
FROM nginx:stable-alpine AS final
# Copy the custom nginx template
COPY default.conf.template /etc/nginx/templates/default.conf.template
# Clean default Nginx files
RUN rm -rf /usr/share/nginx/html/*
# Use project name to locate correct dist output
ARG PROJECT=""
COPY --from=base /app/dist/${PROJECT}/browser /usr/share/nginx/html
# Replace the default nginx conf
COPY ./default.conf.template /etc/nginx/templates/default.conf.template
# Ensure correct file ownership
RUN chown -R nginx:nginx /usr/share/nginx/html
# Set appropriate permissions
RUN chmod -R 755 /usr/share/nginx/html
EXPOSE 80
# Render template and launch nginx
CMD ["nginx", "-g", "daemon off;"]
Expected Behavior
npm should install packages correctly and be able to complete the build.
Steps To Reproduce
- In this environment...
- With this config...
- Run '...'
- See error...
Environment
- npm:
- Node.js:
- OS Name:
- System Model Name:
- npm config:
; copy and paste output from `npm config ls` hereMetadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds review for next stepsneeds review for next steps