Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faild to build image #29

Closed
0FiRE0 opened this issue Nov 24, 2022 · 1 comment
Closed

Faild to build image #29

0FiRE0 opened this issue Nov 24, 2022 · 1 comment

Comments

@0FiRE0
Copy link

0FiRE0 commented Nov 24, 2022

Not possible to build image as it is throwing an exception from Node JS.

Please refer to the below building log:

admin@server:~/projects/EnBizCard$ sudo docker-compose --project-name enbizcard up -d
Building app
Step 1/9 : FROM node:lts-alpine AS build
 ---> 0fa08f92e64b
Step 2/9 : WORKDIR /app
 ---> Using cache
 ---> b7573e63439f
Step 3/9 : COPY package*.json ./
 ---> Using cache
 ---> d393cab4f357
Step 4/9 : RUN npm i
 ---> Using cache
 ---> 192fd3581070
Step 5/9 : COPY . .
 ---> 2f9d210ab0b2
Step 6/9 : RUN npm run generate
 ---> Running in ee8c4062666b

> enbizcard@1.0.0 generate
> nuxt generate

ℹ Using Tailwind CSS from ~/assets/css/tailwind.css
ℹ Merging Tailwind config from ~/tailwind.config.js
ℹ Production build
ℹ Bundling only for client side
ℹ Target: static
ℹ Using components loader to optimize imports
ℹ Discovered Components: node_modules/.cache/nuxt/components/readme.md
✔ Builder initialized
✔ Nuxt files generated
ℹ Compiling Client

 ERROR  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 handleParseError (/app/node_modules/webpack/lib/NormalModule.js:471:10)
    at /app/node_modules/webpack/lib/NormalModule.js:503:5
    at /app/node_modules/webpack/lib/NormalModule.js:358:12
    at /app/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/app/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/app/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
    at /app/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:236:3
    at runSyncOrAsync (/app/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
    at iterateNormalLoaders (/app/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
    at Array.<anonymous> (/app/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9

node:internal/crypto/hash:71
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

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 handleParseError (/app/node_modules/webpack/lib/NormalModule.js:471:10)
    at /app/node_modules/webpack/lib/NormalModule.js:503:5
    at /app/node_modules/webpack/lib/NormalModule.js:358:12
    at /app/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/app/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at Array.<anonymous> (/app/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
    at /app/node_modules/graceful-fs/graceful-fs.js:123:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.12.1
ERROR: Service 'app' failed to build: The command '/bin/sh -c npm run generate' returned a non-zero code: 1
@vishnuraghavb
Copy link
Owner

The issue was fixed by specifying a supported node version in the docker file. Please pull the changes and retry the command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants