Medium / phantomjs

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

Install fails at the phantomjs-prebuilt@2.1.14 #654

Open babignano opened 7 years ago

babignano commented 7 years ago

We've ran into an issue today on our build servers with what seems to be either a missing or broken dependency with 2.1.14

> phantomjs-prebuilt@2.1.14 install /var/lib/node_modules/phantom/node_modules/phantomjs-prebuilt
> node install.js

module.js:327
    throw err;
    ^

Error: Cannot find module 'is-property'
    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> (/var/lib/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/index.js:1:80)
    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)

Adding version 2.1.13 to our package.json file fixes the issue as its another depedency that is pulling in version 2.1.14.

This is also on Ubuntu box - Mac is fine.

babignano commented 7 years ago

Versions: node v4.6.2 npm v2.15.11

nicks commented 7 years ago

have you tried running an npm cache clean? if the dependency is only missing on your ubuntu box that points to an npm bug.

On Mon, Dec 12, 2016 at 12:02 AM, Biagio Abignano notifications@github.com wrote:

Versions: node v4.6.2 npm v2.15.11

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Medium/phantomjs/issues/654#issuecomment-266343881, or mute the thread https://github.com/notifications/unsubscribe-auth/AARAcURZiJEXuflnQR4UG07uCZ5KF_FTks5rHNVUgaJpZM4LKL-J .

k0nserv commented 7 years ago

We are seeing a similar issues with node 4.7 and npm 2.15.11 running under linux.

module.js:327
    throw err;
    ^

Error: Cannot find module './types'
    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> (/opt/skyscanner/teamcity/agent/work/4686d46ea431e707/CoffeeMachine/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/asn1/lib/ber/index.js:4:13)
    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)
k0nserv commented 7 years ago

I could reproduce locally on my mac with

Similar error were it couldn't find generate-object-property.

The following line in package.json

    "phantomjs-prebuilt": "^2.1.12",
apaatsio commented 7 years ago

I had the same problem (node 4.6.2, npm 2.15.11, phantomjs-prebuilt 2.1.14).

It got fixed by changing request version to exactly 2.78.0 in package.json. With version 2.79.0 I'm getting the error. I have to admit I don't know why but for me it worked.

AlokJoshi commented 7 years ago

I am installing auth0-react-sample but I am getting an error- PhantomJS not found on path while installing phantomjs-prebuilt@2.1.14. I then created a separate project in which my package.json had only that install and I still got the same error. I am using windows 7, npm 4.0.2 and node 6.9.1. Last few lines from the log:

8426 verbose stack Error: phantomjs-prebuilt@2.1.14 install: node install.js 8426 verbose stack Exit status 1 8426 verbose stack at EventEmitter. (C:\Users\Alok\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:279:16) 8426 verbose stack at emitTwo (events.js:106:13) 8426 verbose stack at EventEmitter.emit (events.js:191:7) 8426 verbose stack at ChildProcess. (C:\Users\Alok\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:40:14) 8426 verbose stack at emitTwo (events.js:106:13) 8426 verbose stack at ChildProcess.emit (events.js:191:7) 8426 verbose stack at maybeClose (internal/child_process.js:877:16) 8426 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) 8427 verbose pkgid phantomjs-prebuilt@2.1.14 8428 verbose cwd C:\phantomjstest 8429 error Windows_NT 6.1.7601 8430 error argv "C:\Program Files\nodejs\node.exe" "C:\Users\Alok\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "i" 8431 error node v6.9.1 8432 error npm v4.0.2 8433 error code ELIFECYCLE 8434 error phantomjs-prebuilt@2.1.14 install: node install.js 8434 error Exit status 1 8435 error Failed at the phantomjs-prebuilt@2.1.14 install script 'node install.js'. 8435 error Make sure you have the latest version of node.js and npm installed. 8435 error If you do, this is most likely a problem with the phantomjs-prebuilt package, 8435 error not with npm itself. 8435 error Tell the author that this fails on your system: 8435 error node install.js 8435 error You can get information on how to open an issue for this project with: 8435 error npm bugs phantomjs-prebuilt 8435 error Or if that isn't available, you can get their info via: 8435 error npm owner ls phantomjs-prebuilt 8435 error There is likely additional logging output above. 8436 verbose exit [ 1, true ]

billyvg commented 7 years ago

Also getting this node v4.5.0, npm 2.15.9 (or yarn 0.18.1), circleCI Ubuntu:

> chromedriver@2.27.1 install /home/ubuntu/opstarts/app/node_modules/chimp/node_modules/chromedriver
> node install.js

Downloading https://chromedriver.storage.googleapis.com/2.27/chromedriver_linux64.zip
Saving to /tmp/chromedriver/chromedriver_linux64.zip
Receiving...
Received 781K...
Received 1568K...
Received 2352K...
Received 3136K...
Received 3259K total.
Extracting zip contents
Copying to target path /home/ubuntu/opstarts/app/node_modules/chimp/node_modules/chromedriver/lib/chromedriver
Fixing file permissions
Done. ChromeDriver binary available at /home/ubuntu/opstarts/app/node_modules/chimp/node_modules/chromedriver/lib/chromedriver/chromedriver

> phantomjs-prebuilt@2.1.14 install /home/ubuntu/opstarts/app/node_modules/chimp/node_modules/phantomjs-prebuilt
> node install.js

module.js:327
    throw err;
    ^

Error: Cannot find module 'generate-object-property'
    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> (/home/ubuntu/opstarts/app/node_modules/chimp/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/index.js:1:76)
    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)

> spawn-sync@1.0.15 postinstall /home/ubuntu/opstarts/app/node_modules/chimp/node_modules/xolvio-sync-webdriverio/node_modules/webdriverio/node_modules/inquirer/node_modules/external-editor/node_modules/spawn-sync
> node postinstall
mirzazeyrek commented 7 years ago

I had the same issue with:

npm install -g phantomjs and sudo npm install -g phantomjs-prebuilt

I have tried several different versions but it didn't helped.

Finally decided to go with sudo npm install -g phantomjs and it worked.

bajtos commented 7 years ago

This is almost certainly a duplicate of https://github.com/Medium/phantomjs/issues/607.

This was solved by 84438f5 so I bet that it was broken by the removal of the bundle dependencies in 076b959.

YutHelloWorld commented 7 years ago

it works for me @mirzazeyrek

SiyabongaNzulwana commented 6 years ago

I am also facing a similar issue when deploying on docker... all is fine on my local machine, Please help I am not sure what is wrong here. but when I run npm ls react-scripts It gives me an (empty) response. How do I make sure that when I deploy this file is loaded, I am thinking it might be the issue

events.js:136
      throw er; // Unhandled 'error' event
      ^

Error: watch /app/client/public EMFILE
    at _errnoException (util.js:1031:13)
    at FSWatcher.start (fs.js:1397:19)
    at Object.fs.watch (fs.js:1423:11)
    at createFsWatchInstance (/app/client/node_modules/chokidar/lib/nodefs-handler.js:37:15)
    at setFsWatchListener (/app/client/node_modules/chokidar/lib/nodefs-handler.js:80:15)
    at FSWatcher.NodeFsHandler._watchWithNodeFs (/app/client/node_modules/chokidar/lib/nodefs-handler.js:228:14)
    at FSWatcher.NodeFsHandler._handleDir (/app/client/node_modules/chokidar/lib/nodefs-handler.js:407:19)
    at FSWatcher.<anonymous> (/app/client/node_modules/chokidar/lib/nodefs-handler.js:455:19)
    at FSWatcher.<anonymous> (/app/client/node_modules/chokidar/lib/nodefs-handler.js:460:16)
    at FSReqWrap.oncomplete (fs.js:167:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! finchatbot-frontend@0.1.0 start-js: `PORT=3000 react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the finchatbot-frontend@0.1.0 start-js script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-09-20T11_57_04_193Z-debug.log
ERROR: "start-js" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! finchatbot-frontend@0.1.0 start: `npm-run-all -p watch-css start-js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the finchatbot-frontend@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-09-20T11_57_04_270Z-debug.log
apaatsio commented 6 years ago

@SiyabongaNzulwana, Your error looks completely different from the original bug report of this thread. It looks like you're getting an EMFILE error which means you have reached your OS's limit for open files.

More importantly, Phantomjs has been abandoned a long time ago. I recommend switching to puppeteer or Headless Chrome.