Help with config issue ... installing html2pdf and no longer building


I’m trying to get html2pdf up+running from @sid. I’ve got the components installed but it’s no longer building the app - error as follows.

Any ideas? Clearly I’ve screwed something up.


Step 15/16 : RUN npm install --no-optional --production
—> Running in 2d18392d6196
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I’ll try
to do my best with it!

sharp@0.29.3 install /opt/node_app/node_modules/sharp
(node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)

sharp: Downloading

puppeteer@19.1.0 postinstall /opt/node_app/node_modules/puppeteer
node install.js

throw err;

Error: Cannot find module ‘fs/promises’
Require stack:

  • /opt/node_app/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserFetcher.js
  • /opt/node_app/node_modules/puppeteer-core/lib/cjs/puppeteer/puppeteer-core.js
  • /opt/node_app/node_modules/puppeteer/lib/cjs/puppeteer/node/install.js
  • /opt/node_app/node_modules/puppeteer/install.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object. (/opt/node_app/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserFetcher.js:60:20)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions…js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19) {
    code: ‘MODULE_NOT_FOUND’,
    requireStack: [
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! puppeteer@19.1.0 postinstall: node install.js
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the puppeteer@19.1.0 postinstall script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-10-23T10_35_37_057Z-debug.log
The command ‘/bin/sh -c npm install --no-optional --production’ returned a non-zero code: 1
ERROR: Service ‘web’ failed to build : Build failed
Error Launching Services!

What is the NodeJS version? Direct error search shows NodeJS version needs to be 14 or above.

I’m doing a revert to backup at the moment. Try to get back to where I was and then take a look again

Getting closer. Now down to this:

sharp: Installation error: Expected Node.js version >=14.15.0 but found 12.22.12

Where do I update to later node version ?


Are you using docker?
If yes, in the docker target settings there is an option to set NodeJS version.

1 Like

Thanks Siddhant. On it.

Hi @sid dhant,

For info, All good now up+running. thanks for your help and the component.

If you’re ever looking for a great job, ping me.


Glad to see its working well for you.

Will keep that in mind. :slight_smile:

1 Like