question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Docker ENOENT error on alpine

See original GitHub issue

Hi, I am trying with this dockerfile:

FROM mhart/alpine-node:11.2.0

RUN npm -g config set user root
ENV NODE_PATH=/usr/lib/node_modules

RUN npm install -g html-pdf
RUN npm list -g --depth 0

WORKDIR /usr/src/app
COPY package.json package-lock.json ./

ENV NODE_ENV=production
RUN npm install --only=production
RUN npm audit fix

COPY . .
EXPOSE 8080
CMD ["node", "index.js"]

It installs everything correctly but when I try to use html-pdf I am still getting this error:

{
  Error: spawn /node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs ENOENT
  at Process.ChildProcess._handle.onexit(internal/child_process.js: 246: 19)
  at onErrorNT(internal /child_process.js: 421: 16)
  at process.internalTickCallback(internal/process/next_tick.js: 72: 19)
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn /node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs',
  path: '/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs',
  spawnargs: ['/node_modules/html-pdf/lib/scripts/pdf_a4_portrait.js']
}

I am not setting any phantomPath to html-pdf create options.

I am trying this on https://zeit.co/

RUN npm list -g --depth 0 is returning an empty list

If this problem is unsolvable I could use another image! I have a working container using node:8.11.1 but it is a 800Mb image and I need something smaller. What would you use?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:8

github_iconTop GitHub Comments

15reactions
nasir03082409229commented, Jan 11, 2019

great

Great console.log("Great")

14reactions
nasir03082409229commented, Jan 11, 2019

great

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flow-bin exiting with ENOENT in alpine docker container #8846
I am unable to run flow in Docker Alpine image in ci pipeline after upgrading it to latest version. Similar issues has been...
Read more >
ENONENT when executing shell script in Docker container
If you would like to use shell scripts in alpine you have to install a package called bash . It happens because alpine...
Read more >
How can I get ng e2e to run under Alpine: it currently returns E ...
ENOENT is a classic symptom of a missing dynamic linker; see e.g. Why does chroot get ENOENT on an existing file?
Read more >
How to use Puppeteer inside a Docker container
now i am trying to dockerize it and it get's deployed but throws the following error. "Failed to launch the browser process! spawn...
Read more >
no such file or directory, open '/usr/app/package.json' CI error ...
when i'm try to run docker-compose run bona_api ls it only returns node_modules. Dockerfile: FROM node:16.3.0-alpine WORKDIR /usr/app COPY ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found