Medium / phantomjs

NPM wrapper for installing phantomjs
Other
1.43k stars 435 forks source link

Error: Cannot find module 'request-progress' in Docker image #581

Closed amir20 closed 8 years ago

amir20 commented 8 years ago

Possibly related to #330.

docker run -it node:latest bash
npm install phantomjs-prebuilt

Errors with

Error: Cannot find module 'request-progress'
    at Function.Module._resolveFilename (module.js:440:15)
    at Function.Module._load (module.js:388:25)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/node_modules/phantomjs-prebuilt/install.js:9:23)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)

Here is a gist of output.

I am not sure what is going on. This problem doesn't happen on Mac. Possibly related to Ubuntu. I also tried with this Dockerfile

FROM ubuntu:16.04
MAINTAINER Amir Raminfar <findamir@gmail.com>

RUN apt-get update && apt-get install -y curl
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
RUN apt-get install -y nodejs build-essential g++ flex bison gperf ruby perl \
  libsqlite3-dev libfontconfig1-dev libicu-dev libfreetype6 libssl-dev \
  libpng-dev libjpeg-dev python libx11-dev libxext-dev

RUN npm install phantomjs-prebuilt

But I get same error.

Any body know what is going on?

rmg commented 8 years ago

Maybe a duplicate of #580?

amir20 commented 8 years ago

@rmg I don't think so. I have the latest npm and node.

rmg commented 8 years ago

@amir20 I think you mis-read. I'm suggesting it is a bug in the way phantomjs-prebuilt is published. You could try npm install bundled-phantomjs-prebuilt instead to see if it helps any.

amir20 commented 8 years ago

Oh nice. Let me try.

amir20 commented 8 years ago

Yup, that worked. So I am confused, if the only difference is bundledDependencies, why can't we fix this?

rmg commented 8 years ago

@amir20 looks like #585 was merged and released - give npm install phantomjs-prebuilt another try and see if 2.1.9 works for you :-)

amir20 commented 8 years ago

I can confirm it works now. :)

palmerabollo commented 7 years ago

I am facing the same issue with 2.1.13, trying to npm install phantomjs-prebuilt on Alpine Linux.

$ npm install phantomjs-prebuilt

> phantomjs-prebuilt@2.1.13 install /node_modules/phantomjs-prebuilt
> node install.js

module.js:442
    throw err;
    ^

Error: Cannot find module 'request-progress'
    at Function.Module._resolveFilename (module.js:440:15)
    at Function.Module._load (module.js:388:25)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/node_modules/phantomjs-prebuilt/install.js:9:23)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
npm WARN enoent ENOENT: no such file or directory, open '/package.json'
npm WARN !invalid#1 No description
npm WARN !invalid#1 No repository field.
npm WARN !invalid#1 No README data
npm WARN !invalid#1 No license field.
npm ERR! Linux 4.4.20-moby
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "phantomjs-prebuilt"
npm ERR! node v6.2.0
npm ERR! npm  v3.8.9
npm ERR! code ELIFECYCLE

npm ERR! phantomjs-prebuilt@2.1.13 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phantomjs-prebuilt@2.1.13 install script 'node install.js'.
yusufali2205 commented 7 years ago

I'm facing the same issue with 2.1.13

npm info lifecycle phantomjs-prebuilt@2.1.13~install: phantomjs-prebuilt@2.1.13

> phantomjs-prebuilt@2.1.13 install /node_modules/phantomjs-prebuilt
> node install.js

module.js:442
    throw err;
    ^

Error: Cannot find module 'request-progress'
    at Function.Module._resolveFilename (module.js:440:15)
    at Function.Module._load (module.js:388:25)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/node_modules/phantomjs-prebuilt/install.js:9:23)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
npm info lifecycle phantomjs-prebuilt@2.1.13~install: Failed to exec install script