Medium / phantomjs

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

npm ERR! phantomjs-prebuilt@2.1.11 install: `node install.js` #600

Closed carsonip closed 8 years ago

carsonip commented 8 years ago

Using docker image node:6.3.1-slim. (I have tested in my own system and it works. Weird stuff.)

Any thoughts?

System info:

npm ERR! Linux 4.4.0-31-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--verbose" "phantomjs-prebuilt@2.1.10"
npm ERR! node v6.3.1
npm ERR! npm  v3.10.3
npm ERR! code ELIFECYCLE

Error message:

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

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

module.js:442
    throw err;
    ^

Error: Cannot find module 'es6-promise'
    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/lib/phantomjs.js:11:15)
    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 verb lifecycle phantomjs-prebuilt@2.1.10~install: unsafe-perm in lifecycle false
npm verb lifecycle phantomjs-prebuilt@2.1.10~install: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/node_modules/phantomjs-prebuilt/node_modules/.bin:/node_modules/.bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
npm verb lifecycle phantomjs-prebuilt@2.1.10~install: CWD: /node_modules/phantomjs-prebuilt
npm info lifecycle phantomjs-prebuilt@2.1.10~install: Failed to exec install script
npm verb unlock done using /root/.npm/_locks/staging-781faa38490e6896.lock for /node_modules/.staging
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 verb stack Error: phantomjs-prebuilt@2.1.10 install: `node install.js`
npm verb stack Exit status 1
npm verb stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:242:16)
npm verb stack     at emitTwo (events.js:106:13)
npm verb stack     at EventEmitter.emit (events.js:191:7)
npm verb stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
npm verb stack     at emitTwo (events.js:106:13)
npm verb stack     at ChildProcess.emit (events.js:191:7)
npm verb stack     at maybeClose (internal/child_process.js:852:16)
npm verb stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
npm verb pkgid phantomjs-prebuilt@2.1.10
npm verb cwd /

and I suppose es6-promise is listed as a dependency and it is installed:

npm info lifecycle es6-promise@3.2.1~install: es6-promise@3.2.1
carsonip commented 8 years ago

I realize the bzip2 isn't installed, causing the installation to fail. Will create a pull request to improve the README.md.

carsonip commented 8 years ago

Error: Cannot find module 'es6-promise' can be resolved through setting a WORKDIR other than file system root in docker.

westy92 commented 8 years ago

I received this same error using node:6.3.1, which already included bzip2. I'll look into the WORKDIR fix.

westy92 commented 8 years ago

@carsonip what did you end up setting your WORKDIR to?

carsonip commented 8 years ago

@westy92 something like /usr/src/myproj should work.

westy92 commented 8 years ago

This worked for me!

FROM node:6.3.1

WORKDIR /usr/src

COPY . .
RUN npm install --production

CMD [ "npm", "start" ]