在centos服务器上 build前端是报错。相同的操作在mac上没有问题
Step 5/9 : RUN npm run build:prod
---> Running in 63802b1fd03f
> vue-admin-template@4.4.0 build:prod
> vue-cli-service build
- Building for production...
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/kubeimooc-web/node_modules/webpack/lib/util/createHash.js:135:53)
at NormalModule._initBuildHash (/app/kubeimooc-web/node_modules/webpack/lib/NormalModule.js:417:16)
at handleParseError (/app/kubeimooc-web/node_modules/webpack/lib/NormalModule.js:471:10)
at /app/kubeimooc-web/node_modules/webpack/lib/NormalModule.js:503:5
at /app/kubeimooc-web/node_modules/webpack/lib/NormalModule.js:358:12
at /app/kubeimooc-web/node_modules/loader-runner/lib/LoaderRunner.js:373:3
at iterateNormalLoaders (/app/kubeimooc-web/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
at iterateNormalLoaders (/app/kubeimooc-web/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
at /app/kubeimooc-web/node_modules/loader-runner/lib/LoaderRunner.js:236:3
at runSyncOrAsync (/app/kubeimooc-web/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
at iterateNormalLoaders (/app/kubeimooc-web/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
at Array.<anonymous> (/app/kubeimooc-web/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
at Storage.finished (/app/kubeimooc-web/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
at /app/kubeimooc-web/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
/app/kubeimooc-web/node_modules/loader-runner/lib/LoaderRunner.js:114
throw e;
^
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/kubeimooc-web/node_modules/webpack/lib/util/createHash.js:135:53)
at NormalModule._initBuildHash (/app/kubeimooc-web/node_modules/webpack/lib/NormalModule.js:417:16)
at handleParseError (/app/kubeimooc-web/node_modules/webpack/lib/NormalModule.js:471:10)
at /app/kubeimooc-web/node_modules/webpack/lib/NormalModule.js:503:5
at /app/kubeimooc-web/node_modules/webpack/lib/NormalModule.js:358:12
at /app/kubeimooc-web/node_modules/loader-runner/lib/LoaderRunner.js:373:3
at iterateNormalLoaders (/app/kubeimooc-web/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
at iterateNormalLoaders (/app/kubeimooc-web/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
at /app/kubeimooc-web/node_modules/loader-runner/lib/LoaderRunner.js:236:3
at context.callback (/app/kubeimooc-web/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
at /app/kubeimooc-web/node_modules/cache-loader/dist/index.js:147:7
at /app/kubeimooc-web/node_modules/graceful-fs/graceful-fs.js:61:14
at FSReqCallback.oncomplete (node:fs:198:23) {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
Node.js v18.16.0
The command '/bin/sh -c npm run build:prod' returned a non-zero code: 1