我在openshift上部署React应用程序时遇到问题。该应用程序可以在具有docker的本地计算机上完美运行,但是在我将其部署到openshift时会立即显示此错误。
错误如下:
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! app@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the app@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
相同的dockerfile是
FROM node:10.14.2
EXPOSE 3000
# Create app directory
WORKDIR /src/app
COPY . .
WORKDIR /src
RUN chmod -R 777 app
WORKDIR /src/app
RUN npm install -g npm@latest
RUN rm -rf node_modules
RUN npm remove webpack
RUN npm install webpack@4.19.1
RUN npm install
CMD ["npm", "start"]