Medium / phantomjs

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

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

Open yusufali2205 opened 7 years ago

yusufali2205 commented 7 years ago

I'm getting this error while installing phantomjs-prebuild v2.1.13 in the docker image on mac. Looks like this issue was reported earlier in version 2.1.9 #581.

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
yusufali2205 commented 7 years ago

I updated my Dockerfile to first just copy the package.json in the docker image working directory, then run npm install and after that copy rest of the app folder. Now I'm not having this issue.

FROM node:6.3.0

# Create app directory
RUN mkdir -p /src/app
WORKDIR /src/app

# install all the dependencies
COPY package.json /src/app/
RUN npm install

# bundle app source
COPY . /src/app/