docker run image_name
,然后日志抛出了这个错误。Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:71:19)
at Object.createHash (node:crypto:133:10)
at module.exports (/app/node_modules/webpack/lib/util/createHash.js:135:53)
at NormalModule._initBuildHash (/app/node_modules/webpack/lib/NormalModule.js:417:16)
at /app/node_modules/webpack/lib/NormalModule.js:452:10
at /app/node_modules/webpack/lib/NormalModule.js:323:13
at /app/node_modules/loader-runner/lib/LoaderRunner.js:367:11
at /app/node_modules/loader-runner/lib/LoaderRunner.js:233:18
at context.callback (/app/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
at /app/node_modules/babel-loader/lib/index.js:59:103 {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
我的Docker文件如下:
FROM node:18-alpine
EXPOSE 3000
WORKDIR /app
COPY ./frontend/package.json .
RUN npm install
COPY ./frontend .
COPY ./images .
CMD ["npm", "start"]
我认为这可能是与节点版本有关的问题,但我对错误不是非常确定,有人能解释一下这个错误是什么以及如何解决吗?谢谢!