Medium / phantomjs

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

phantomjs-prebuilt@2.1.15 install returns 'Cannot find module' error #735

Open cbonaco1 opened 7 years ago

cbonaco1 commented 7 years ago

Hi,

My team and I are experiencing an issue with downloading version 2.1.15. We are seeing the following error when running npm install

> phantomjs-prebuilt@2.1.15 install /Users/xxx/xxx/node_modules/phantomjs-prebuilt
> node install.js

module.js:327
    throw err;
    ^

Error: Cannot find module 'json-stable-stringify'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/Users/xxx/xxx/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/compile/util.js:19:20)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)

Node version: 4.5.0 Mac OS X El Capitan

Hardcoding the version to 2.1.14 resolves the issue.

This is similar to issue #654

bkimminich commented 7 years ago

I can confirm this is happening on Windows as well: https://ci.appveyor.com/project/bkimminich/juice-shop/build/1657/job/t83dhkqf2jrxcfgv#L24. Pinning to 2.1.14 helped as a workaround.

damache commented 7 years ago

yep. happen here too. running in travis so not sure what OS.

giniedp commented 7 years ago

i dont have an error (description), but during karma tests one scenario is running into a null object and phantomJS exits instantly. Have to roll back to 2.1.14

firebluetom commented 7 years ago

Same error here. Rolled back. I've heard updating node helps too.

damache commented 7 years ago

I had to use the shrinkwrap approach to make sure the version stays at 2.1.14. It works now. user of shrinkwrap is a smart way to control the baseline anyhow.

antony commented 7 years ago

I've got the same issue but for a different module:

Error: Cannot find module 'request-progress'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/ubuntu/finland-client/node_modules/phantomjs-prebuilt/install.js:9:23)
Oliver-Ren commented 7 years ago

We are having the same issue trying to install 2.1.15 on a docker image. back to 2.1.14 works for us.

rimiti commented 6 years ago

I had the same problem. You only have to upgraded npm like: sudo npm i npm@latest -g

Have a nice coding day.

KlavierCat commented 6 years ago

I was on npm v8.0.0, I run into the same problem, downgrade to 2.1.14 works for me. Then I upgrade to npm v8.9.4, and now 2.1.15 / 2.1.16 works for me too.