You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
while running RUN npm install pm2 -g in docker creation of my node app
I am getting:
npm error code TAR_BAD_ARCHIVE
npm error TAR_BAD_ARCHIVE: Unrecognized archive format
Dockerfile:
FROM node:18-slim
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm i --only=production
COPY . .
RUN npm install pm2 -g
tried below also still same
RUN npm cache clean --force && npm install pm2 -g
EXPOSE 1337
CMD ["pm2-runtime", "dist/server.js"]
Expected Behavior
It should install pm2 properly in the docker container
Steps To Reproduce
Docker base image tested on: node:18-slim, node:18,node:16,node:16-slim,node:alpine,node:latest,node:18-slim,node:18,node:22,node:20
2.Manually test the PM2 installation:
Run a temporary container for debugging:
docker run -it --rm node:18-slim bash
Inside the container, run:
npm cache clean --force && npm install -g pm2
70.30 npm error code TAR_BAD_ARCHIVE
70.30 npm error TAR_BAD_ARCHIVE: Unrecognized archive format
70.30 npm error A complete log of this run can be found in: /root/.npm/_logs/2024-12-17T13_05_42_763Z-debug-0.log
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
while running RUN npm install pm2 -g in docker creation of my node app
I am getting:
npm error code TAR_BAD_ARCHIVE
npm error TAR_BAD_ARCHIVE: Unrecognized archive format
Dockerfile:
FROM node:18-slim
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm i --only=production
COPY . .
RUN npm install pm2 -g
tried below also still same
RUN npm cache clean --force && npm install pm2 -g
EXPOSE 1337
CMD ["pm2-runtime", "dist/server.js"]
Expected Behavior
It should install pm2 properly in the docker container
Steps To Reproduce
2.Manually test the PM2 installation:
Run a temporary container for debugging:
docker run -it --rm node:18-slim bash
Inside the container, run:
npm cache clean --force && npm install -g pm2
error encountered:
npm error code TAR_BAD_ARCHIVE
npm error TAR_BAD_ARCHIVE: Unrecognized archive format
Environment
The text was updated successfully, but these errors were encountered: