ds300 / patch-package

Fix broken node modules instantly 🏃🏽‍♀️💨
MIT License
10.46k stars 295 forks source link

No patch files found in docker #366

Open Parkseokje opened 2 years ago

Parkseokje commented 2 years ago

The command runs but says no patch file found. Any workround ?

Dockerfile

# build stage
FROM node:lts-alpine as build-stage

WORKDIR /app
COPY package*.json patches ./
RUN npm install --unsafe-perm
COPY . .
RUN npm run build

# production stage
FROM nginx:stable-alpine as production-stage
COPY  ./nginx/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build-stage /app/dist /usr/share/nginx/html
# EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

Docker compose logs

Step 1/10 : FROM node:lts-alpine as build-stage
 ---> 710c8aa630d5
Step 2/10 : WORKDIR /app
 ---> Running in fb0b317f7086
 ---> 96e6a3fa9102
Step 3/10 : COPY package*.json patches ./
 ---> 6ec01f4331d9
Step 4/10 : RUN npm install --unsafe-perm
 ---> Running in 4388874e0da1
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

> haezoom_vue@0.0.0 postinstall
> patch-package

patch-package 6.4.7
Applying patches...
No patch files found
eduhenke commented 2 years ago

Same thing is happening to me, Dockerfile:

FROM node:14.16-alpine

# Create and change to the app directory.
WORKDIR /usr/src/app

# Copy application dependency manifests to the container image.
# A wildcard is used to ensure both package.json AND yarn.lock are copied.
# Copying this separately prevents re-running npm install on every code change.
COPY .npmrc ./
COPY .yarnrc ./
COPY package.json ./
COPY yarn.lock ./
COPY patches .

# Install production dependencies.
RUN yarn

# Copy local code to the container image.
COPY . ./

RUN yarn build
ENV NODE_ENV production
# Run the web service on container startup.
CMD [ "npm", "start" ]
mfs-abhinav commented 2 years ago

Do we have any update? I'm facing same issue "No patch files found"

mfs-abhinav commented 2 years ago

Do we have any update? I'm facing same issue "No patch files found"

Found the fix. You will have to copy the patches directory like below: COPY patches ./patches

intellix commented 2 years ago

I got this as well and wonder if it shouldn't fail but instead treat it as no patches? I've had it when sharing Docker files between projects where there are none and I end up creating a .gitkeep file inside patches folder just to satisfy it