【发布时间】:2022-01-09 18:35:09
【问题描述】:
当我在笔记本电脑上运行项目时,一切正常 但是当我构建图像 docker 并运行时我给出错误请帮助我 我的笔记本电脑使用节点 12
/var/www/html/jardinsgmc/node_modules/puppeteer/lib/cjs/puppeteer/common/AriaQueryHandler.js:30
const attributeRegexp = /\[\s*(?<attribute>\w+)\s*=\s*"(?<value>\\.|[^"\\]*)"\s*\]/g;
^
SyntaxError: Invalid regular expression: /\[\s*(?<attribute>\w+)\s*=\s*"(?<value>\\.|[^"\\]*)"\s*\]/: Invalid group
at Object.<anonymous> (/var/www/html/jardinsgmc/node_modules/puppeteer/lib/cjs/puppeteer/common/AriaQueryHandler.js:30:25)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/var/www/html/jardinsgmc/node_modules/puppeteer/lib/cjs/puppeteer/common/QueryHandler.js:19:31)
at Module._compile (module.js:653:30)
这是我的 dockerfile。我刚刚安装了一些假的东西并运行了节点服务器
FROM node:12-alpine AS BUILD_IMAGE
RUN apk update && apk add python3 py3-pip make g++ && rm -rf /var/cache/apk/*
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
FROM ubuntu:18.04
WORKDIR /usr/src/app
COPY . .
COPY --from=BUILD_IMAGE /usr/src/app/node_modules ./node_modules
RUN apt-get update
RUN yes | apt-get install apt-utils
RUN yes | apt-get install ffmpeg
RUN yes | apt-get install nodejs
EXPOSE 8082
CMD [ "node", "server.js" ]
【问题讨论】: