Medium / phantomjs

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

New project trying to install phantom-prebuilt @2.1.11 and getting errors #599

Closed angelsk closed 8 years ago

angelsk commented 8 years ago

package.json contains:

"devDependencies": {
      "phantomjs-prebuilt": "~2.1.7"
}

running build task

npm-install:
     [exec] npm http GET https://registry.npmjs.org/phantomjs-prebuilt
     [exec] npm http 304 https://registry.npmjs.org/phantomjs-prebuilt
     [exec] npm http GET https://registry.npmjs.org/es6-promise
     [exec] npm http 200 https://registry.npmjs.org/es6-promise
     [exec] 
     [exec] > phantomjs-prebuilt@2.1.11 install /srv/www/tomato-site/current/features/node_modules/phantomjs-prebuilt
     [exec] > node install.js
     [exec] 
     [exec] (node) child_process: options.customFds option is deprecated. Use options.stdio instead.
     [exec] module.js:327
     [exec]     throw err;
     [exec]     ^
     [exec] 
     [exec] Error: Cannot find module 'throttleit'
     [exec]     at Function.Module._resolveFilename (module.js:325:15)
     [exec]     at Function.Module._load (module.js:276:25)
     [exec]     at Module.require (module.js:353:17)
     [exec]     at require (internal/module.js:12:17)
     [exec]     at Object.<anonymous> (/srv/www/tomato-site/current/features/node_modules/phantomjs-prebuilt/node_modules/request-progress/index.js:3:16)
     [exec]     at Module._compile (module.js:409:26)
     [exec]     at Object.Module._extensions..js (module.js:416:10)
     [exec]     at Module.load (module.js:343:32)
     [exec]     at Function.Module._load (module.js:300:12)
     [exec]     at Module.require (module.js:353:17)
     [exec] npm ERR! weird error 1
     [exec] npm ERR! not ok code 0

Is this a transient thing? I can't see 2.1.11 tagged; but it's in npm from yesterday.

Using node -v v4.4.7 on Centos.

gonzofish commented 8 years ago

Also having the same issue coming here via Karma PhantomJS launcher which is referring to ^2.1.7, which obviously picks up 2.1.11...

throttleit is a library required by request-progress but I'm not sure why it wouldn't be installing.

tstackhouse commented 8 years ago

Seeing this in an existing project as well with ^2.1.6 in our package.json. Making the reference 2.1.6 fixes the problem for now, but obviously locking the version like that is less than ideal.

nicks commented 8 years ago

what version of npm are you using? can somebody include their full log?

nicks commented 8 years ago

also, please provide complete repro steps. Are you able to reproduce the issue by directly running npm install phantomjs-prebuilt, or only when building as part of a larger project?

it seems like an npm bug, and might be worth filing against npm

On Tue, Aug 9, 2016 at 1:51 PM, Tim Stackhouse notifications@github.com wrote:

Seeing this in an existing project as well with ^2.1.6 in our package.json. Making the reference 2.1.6 fixes the problem for now, but obviously locking the version like that is less than ideal.

— 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/599#issuecomment-238634466, or mute the thread https://github.com/notifications/unsubscribe-auth/AARAcWhqUgLV9Oxmyzca2oJ9g7l5D1IXks5qeL4ggaJpZM4JgRin .

tstackhouse commented 8 years ago

If our build system logs are to be believed, running:

node v0.10.36 npm v1.3.6

Sanitized log from a failed build follows:

[INFO] --- grunt-maven-plugin:1.4.0:npm (default) @ redacted ---
[INFO] OS Name: Linux
npm http GET https://registry.npmjs.org/grunt-contrib-less
npm http GET https://registry.npmjs.org/phantomjs-prebuilt
npm http 304 https://registry.npmjs.org/grunt-contrib-less
npm http 304 https://registry.npmjs.org/phantomjs-prebuilt
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/less
npm http 200 https://registry.npmjs.org/lodash
npm http 200 https://registry.npmjs.org/async
npm http 200 https://registry.npmjs.org/less
npm http GET https://registry.npmjs.org/async/-/async-2.0.1.tgz
npm http GET https://registry.npmjs.org/less/-/less-2.7.1.tgz
npm http 200 https://registry.npmjs.org/async/-/async-2.0.1.tgz
npm http 200 https://registry.npmjs.org/less/-/less-2.7.1.tgz
npm http GET https://registry.npmjs.org/es6-promise
npm http 304 https://registry.npmjs.org/es6-promise

phantomjs-prebuilt@2.1.11 install /repo/jenkins/workspace/build/redacted/node_modules/phantomjs-prebuilt node install.js

module.js:340 throw err; ^ Error: Cannot find module 'throttleit' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object. (/repo/jenkins/workspace/build/redacted/node_modules/phantomjs-prebuilt/node_modules/request-progress/index.js:3:16) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) npm ERR! weird error 8 npm ERR! tar pack Error reading /tmp/npm-16215-i0YZDrWO/1470754911810-0.8810938792303205/package npm ERR! addLocalDirectory Could not pack "/tmp/npm-16215-i0YZDrWO/1470754911810-0.8810938792303205/package" to "/tmp/npm-733/.npm/async/2.0.1/package.tgz" npm ERR! Error: ENOENT, lstat '/tmp/npm-16215-i0YZDrWO/1470754911813-0.3595457663759589/package/dist/less.min.js' npm ERR! If you need help, you may report this log at: npm ERR! http://github.com/isaacs/npm/issues npm ERR! or email it to: npm ERR! npm-@googlegroups.com

npm ERR! System Linux 2.6.32-504.8.1.el6.x86_64 npm ERR! command "node" "/usr/bin/npm" "install" "--color=false" npm ERR! cwd /repo/jenkins/workspace/build/redacted/target-grunt npm ERR! node -v v0.10.36 npm ERR! npm -v 1.3.6 npm ERR! path /tmp/npm-16215-i0YZDrWO/1470754911813-0.3595457663759589/package/dist/less.min.js npm ERR! fstream_path /tmp/npm-16215-i0YZDrWO/1470754911813-0.3595457663759589/package/dist/less.min.js npm ERR! fstream_type File npm ERR! fstream_class FileWriter npm ERR! code ENOENT npm ERR! errno 34 npm ERR! fstream_stack /usr/lib/node_modules/fstream/lib/writer.js:284:26 npm ERR! fstream_stack Object.oncomplete (fs.js:108:15) npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /repo/jenkins/workspace/build/redacted/target-grunt/npm-debug.log npm ERR! not ok code 0

gonzofish commented 8 years ago

Just another note, I'm not having any issue on my Window's box, but when run through Jenkins on a Linux box it is happening.

I've tried npm 1.4.3 (Node 0.10.26), npm 2.5.1 (Node 0.12.0), npm 2.14.12 (Node 4.2.6). Due to work constraints, cannot go above npm 2.x...but all have pretty much the following output:

building:
     [echo] npm version:
     [exec] 2.14.12
     [echo] Running 'npm dedupe'
     [echo] Running 'npm install'
     [exec] npm WARN package.json *@1.6.0 No license field.
     [exec] WARN engine karma@0.12.37: wanted: {"node":">=0.8 <=0.12 || >=1 <=2"} (current: {"node":"4.2.6","npm":"2.14.12"})
     [exec] npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
     [exec] npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
     [exec] npm WARN deprecated lodash@1.0.2: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
     [exec] npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
     [exec] npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
     [exec] npm WARN deprecated graceful-fs@2.0.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
     [exec] npm WARN deprecated graceful-fs@3.0.8: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
     [exec] npm WARN deprecated jade@1.11.0: Jade has been renamed to pug, please install the latest version of pug instead of jade
     [exec] npm WARN optional dep failed, continuing fsevents@1.0.14
     [exec] npm WARN optional dep failed, continuing fsevents@1.0.14
     [exec] npm WARN peerDependencies The peer dependency eslint@>=0.8.0 included from eslint-plugin-angular will no
     [exec] npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
     [exec] npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
     [exec] npm WARN deprecated transformers@2.1.0: Deprecated, use jstransformer
     [exec] 
     [exec] > phantomjs-prebuilt@2.1.11 install /home/jenkins/workspace/.../node_modules/karma-phantomjs-launcher/node_modules/phantomjs-prebuilt
     [exec] > node install.js
     [exec] 
     [exec] module.js:328
     [exec]     throw err;
     [exec]     ^
     [exec] 
     [exec] Error: Cannot find module 'throttleit'
     [exec]     at Function.Module._resolveFilename (module.js:326:15)
     [exec]     at Function.Module._load (module.js:277:25)
     [exec]     at Module.require (module.js:354:17)
     [exec]     at require (internal/module.js:12:17)
     [exec]     at Object.<anonymous> (/home/jenkins/workspace/.../node_modules/karma-phantomjs-launcher/node_modules/phantomjs-prebuilt/node_modules/request-progress/index.js:3:16)
     [exec]     at Module._compile (module.js:410:26)
     [exec]     at Object.Module._extensions..js (module.js:417:10)
     [exec]     at Module.load (module.js:344:32)
     [exec]     at Function.Module._load (module.js:301:12)
     [exec]     at Module.require (module.js:354:17)
     [exec] 
     [exec] > optipng-bin@3.1.2 postinstall /home/jenkins/workspace/.../node_modules/grunt-contrib-imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/optipng-bin
     [exec] > node lib/install.js
     [exec] 
     [exec]   ��� optipng pre-build test passed successfully
     [exec] 
     [exec] > gifsicle@3.0.3 postinstall /home/jenkins/workspace/.../node_modules/grunt-contrib-imagemin/node_modules/imagemin/node_modules/imagemin-gifsicle/node_modules/gifsicle
     [exec] > node lib/install.js
     [exec] 
     [exec] 
     [exec] > jpegtran-bin@3.1.0 postinstall /home/jenkins/workspace/.../node_modules/grunt-contrib-imagemin/node_modules/imagemin/node_modules/imagemin-jpegtran/node_modules/jpegtran-bin
     [exec] > node lib/install.js
     [exec] 
     [exec]   ��� gifsicle pre-build test passed successfully
     [exec] 
     [exec] > ws@0.4.32 install /home/jenkins/workspace/.../node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
     [exec] > (node-gyp rebuild 2> builderror.log) || (exit 0)
     [exec] 
     [exec]   ��� jpegtran pre-build test passed successfully
     [exec] npm ERR! Linux 3.16.0-73-generic
     [exec] npm ERR! argv "/home/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/NodeJS_4.2.6/bin/node" "/home/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/NodeJS_4.2.6/bin/npm" "install"
     [exec] npm ERR! node v4.2.6
     [exec] npm ERR! npm  v2.14.12
     [exec] npm ERR! code ELIFECYCLE
     [exec] 
     [exec] npm ERR! phantomjs-prebuilt@2.1.11 install: `node install.js`
     [exec] npm ERR! Exit status 1
     [exec] npm ERR! 
     [exec] npm ERR! Failed at the phantomjs-prebuilt@2.1.11 install script 'node install.js'.
     [exec] npm ERR! This is most likely a problem with the phantomjs-prebuilt package,
     [exec] npm ERR! not with npm itself.
     [exec] npm ERR! Tell the author that this fails on your system:
     [exec] npm ERR!     node install.js
     [exec] npm ERR! You can get their info via:
     [exec] npm ERR!     npm owner ls phantomjs-prebuilt
     [exec] npm ERR! There is likely additional logging output above.
     [exec] 
     [exec] npm ERR! Please include the following file with any support request:
     [exec] npm ERR!     /home/jenkins/workspace/.../npm-debug.log
tstackhouse commented 8 years ago

That's similar to what we're experiencing, our local workstations (OS X) build fine, but the build fails in Jenkins with that error.

angelsk commented 8 years ago

I am literally just installing phantom as I'm using it with Behat. So it's just doing one install. Don't know offhand what npm version it is, but it was working fine last week with 2.1.1

On 9 Aug 2016, at 19:00, Nick Santos notifications@github.com wrote:

also, please provide complete repro steps. Are you able to reproduce the issue by directly running npm install phantomjs-prebuilt, or only when building as part of a larger project?

it seems like an npm bug, and might be worth filing against npm

On Tue, Aug 9, 2016 at 1:51 PM, Tim Stackhouse notifications@github.com wrote:

Seeing this in an existing project as well with ^2.1.6 in our package.json. Making the reference 2.1.6 fixes the problem for now, but obviously locking the version like that is less than ideal.

— 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/599#issuecomment-238634466, or mute the thread https://github.com/notifications/unsubscribe-auth/AARAcWhqUgLV9Oxmyzca2oJ9g7l5D1IXks5qeL4ggaJpZM4JgRin .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

angelsk commented 8 years ago

npm -v 1.3.6

marklonsdale commented 8 years ago

Yup. We see same issue. Builds fine on OS X with npm 2.14.20. Failing on Ubuntu with npm version 1.3.10.

Started breaking at end of last week. Was working previously. No other known changes in our build environment

schneyra commented 8 years ago

Same problem here. After installing the following dependencies manually,

I ran into another error:

/app/node_modules/hawk/node_modules/boom/lib/index.js:5
const Hoek = require('hoek');
^^^^^
SyntaxError: Use of const in strict mode.

We are running node in version 0.10.25 and npm in version 1.3.10.

gonzofish commented 8 years ago

@schneyra that error is because older Node versions don't support the ES2016 variable keywords (const, let)...not sure that's related to this thread.

alopezo commented 8 years ago

Yes, same thing here, a new install got this new version of phantom-js and can't go through those same dependencies

schneyra commented 8 years ago

@gonzofish Sure, I'm aware of that. I just wanted to let you know what dependencies I had to install manually, before I ran into this problem.

nicks commented 8 years ago

Sorry, I'm unable to reproduce this. The error log says that this is an NPM bug and that you should file a bug against NPM. Maybe they can help? My shot-in-the-dark is that there's some environment variable that screws up package loading during the install process.

angelsk commented 8 years ago

@nicks The only variable that changed for me was phantomjs. Node version same, npm version same, no environment variables - same package.json, only installing one package. Worked last week, now doesn't work.

https://registry.npmjs.org/phantomjs-prebuilt says there is a version 2.1.11 - but on this git repo there isn't a tag for it. Latest release is 2.1.10. Did you release a version 11 and then delete it, but forget to tell npm registry that it was gone? Or did you update the versions of the phantom dependancies?

angelsk commented 8 years ago

@nicks Because of "es6-promise": "^3.2.1", maybe? I don't know enough about node. But as a developer if I didn't change a thing and an install starts failing, then there's only one solution and that's a problem with this package.

NOTE: I have no log saying it's a problem with NPM

angelsk commented 8 years ago

@nicks Sorry to spam. Checked, and last verified working was July 28. I appear to have 2.1.7 installed, which is what I'm copying to the project to run my tests. Going to run a quick test,fixing the versions till I find where it breaks - if that helps.

angelsk commented 8 years ago

@nicks Okay - so: results. (current: {"node":"v4.4.7","npm":"1.3.6"}) - running npm install with single package in package.json as above. Getting error: child_process: options.customFds option is deprecated. Use options.stdio instead. on all installs, so this is not a breaking problem.

This was done by removing node_modules each time, altering package.json and installing. Went back to 2.1.10 after and it installed fine.

Jwagner347 commented 8 years ago

We ran into the same issue, running node 0.10.25 and npm 1.3.10 on Ubuntu Server 14.04 LTS.

Downgrading to phantomjs-prebuilt 2.1.10 worked for us without having to upgrade node.

Thanks @angelsk!

nicks commented 8 years ago

can you try installing phantomjs-prebuilt@2.1.12-alpha and see if that works for you?

On Thu, Aug 11, 2016 at 1:08 PM, Jwagner347 notifications@github.com wrote:

We ran into the same issue, running node 0.10.25 on Ubuntu Server 14.04 LTS.

Downgrading to phantomjs-prebuilt 2.1.10 worked for us without having to upgrade node.

Thanks @angelsk https://github.com/angelsk!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Medium/phantomjs/issues/599#issuecomment-239225830, or mute the thread https://github.com/notifications/unsubscribe-auth/AARAcQBJtk1bE5H23SGZrGuyPsBcekbOks5qe1cqgaJpZM4JgRin .

angelsk commented 8 years ago

Will do tomorrow, thanks

Jo

On 11 Aug 2016, at 18:17, Nick Santos notifications@github.com wrote:

can you try installing phantomjs-prebuilt@2.1.12-alpha and see if that works for you?

On Thu, Aug 11, 2016 at 1:08 PM, Jwagner347 notifications@github.com wrote:

We ran into the same issue, running node 0.10.25 on Ubuntu Server 14.04 LTS.

Downgrading to phantomjs-prebuilt 2.1.10 worked for us without having to upgrade node.

Thanks @angelsk https://github.com/angelsk!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Medium/phantomjs/issues/599#issuecomment-239225830, or mute the thread https://github.com/notifications/unsubscribe-auth/AARAcQBJtk1bE5H23SGZrGuyPsBcekbOks5qe1cqgaJpZM4JgRin .

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

Jwagner347 commented 8 years ago

@nicks phantomjs-prebuilt@2.1.12-alpha seems to install and work fine on my setup.

TigerWiki commented 8 years ago

Same problem:

angelsk commented 8 years ago

@nicks 2.1.12-alpha, when specified, installs fine and everything works. When will this be released?

nicks commented 8 years ago

published!

nicks commented 8 years ago

thanks for your help diagnosing the problem

gonzofish commented 8 years ago

Thanks for your quick response in finding a solution to the problem!

angelsk commented 8 years ago

@nicks Thanks for fixing it!

EgorrodE commented 7 years ago

still having this with 2.1.12

npm ERR! Linux 4.4.0-38-generic npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" npm ERR! node v4.2.6 npm ERR! npm v3.5.2 npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn

npm ERR! phantomjs-prebuilt@2.1.12 install: node install.js npm ERR! spawn ENOENT npm ERR! npm ERR! Failed at the phantomjs-prebuilt@2.1.12 install script 'node install.js'.

EgorrodE commented 7 years ago

fixed it with just

    sudo apt-get install nodejs-legacy