nathanboktae / mocha-phantomjs

:coffee: :ghost: Run client-side mocha tests in the command line through phantomjs
MIT License
954 stars 112 forks source link

npm install is failing for 4.0.0-beta1 on linux #192

Closed socketwiz closed 9 years ago

socketwiz commented 9 years ago

When I try to install mocha-phantomjs it is failing because the phantomjs2 dependency is failing, but I'm not sure how phantomjs2 is a dependency because according to package.js it would seem that phantomjs v1.9 is the dependency, not v2: https://github.com/metaskills/mocha-phantomjs/blob/master/package.json#L39

However, here is what I am seeing:

sudo npm install -g mocha-phantomjs
-
> phantomjs2@2.0.0 install /usr/lib/node_modules/mocha-phantomjs/node_modules/phantomjs2
> node install.js

Downloading https://github.com/bprodoehl/phantomjs/releases/download/2.0.0-20141016/phantomjs-2.0.0-20141016-linux-x86_64.zip
Saving to /usr/lib/node_modules/mocha-phantomjs/node_modules/phantomjs2/phantomjs/phantomjs-2.0.0-20141016-linux-x86_64.zip
Receiving...
Install exited unexpectedly

I tried to create a ticket on the phantomjs repo here: https://github.com/ariya/phantomjs/issues/13376 but it seems that project isn't responsible for the npm installer, they redirected me here: https://github.com/bprodoehl/phantomjs but that project doesn't have issues enabled, so I thought I would give it one last try and post here, since you guys could at least address the dependency on the broken project. Or is this project similar to phantomjs and you don't manage the npm installer either?

socketwiz commented 9 years ago

I just tried this and it worked just fine: npm install -g https://github.com/metaskills/mocha-phantomjs/archive/v3.5.3.tar.gz

So something isn't quite right with whatever is on npm it seems :(

nathanboktae commented 9 years ago

Hmmm doh I put up v4 as an early beta but I thought it should be hidden and not the default... I'll look into that. It's faling as phantomjs2 doesn't have built Linux binaries.

npm install mocha-phantomjs@<4 for now.

nathanboktae commented 9 years ago

Hmm I just did npm install mocha-phantomjs and got 3.5.3. Do you have some npm config setup to get beta packages? I can only get to it by installing the specific version full package version, which is my intention.

~/temp/test
 9:04AM ᐅ npm install mocha-phantomjs@4
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "mocha-phantomjs@4"
npm ERR! node v0.12.2
npm ERR! npm  v2.12.1
npm ERR! code ETARGET

npm ERR! notarget No compatible version found: mocha-phantomjs@'>=4.0.0 <5.0.0'
npm ERR! notarget Valid install targets:
npm ERR! notarget ["1.0.0","1.0.1","1.1.0","1.1.1","1.1.2","1.1.3","2.0.0","2.0.1","2.0.2","2.0.3","3.0.0","3.1.0","3.1.1","3.1.2","3.1.3","3.1.4","3.1.5","3.1.6","3.2.0","3.3.0","3.3.1","3.3.2","3.4.0","3.4.1","3.5.0","3.5.1","3.5.2","3.5.3","4.0.0-beta1"]
npm ERR! notarget
npm ERR! notarget This is most likely not a problem with npm itself.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/nblack/temp/test/npm-debug.log

~/temp/test
 9:05AM ᐅ npm install mocha-phantomjs@4.0.0-beta1
|
> phantomjs2@2.0.0 install /Users/nblack/temp/test/node_modules/mocha-phantomjs/node_modules/phantomjs2
> node install.js

Looks like an `npm install -g`; unable to check for already installed version.
Download already available at /var/folders/81/0crqt_td7nj1v7gwscvg9x9c0000gn/T/phantomjs/phantomjs-2.0.0-20141016-macosx.zip
Extracting zip contents
Removing /Users/nblack/temp/test/node_modules/mocha-phantomjs/node_modules/phantomjs2/lib/phantom
Copying extracted folder /var/folders/81/0crqt_td7nj1v7gwscvg9x9c0000gn/T/phantomjs/phantomjs-2.0.0-20141016-macosx.zip-extract-1436025934720/phantomjs-2.0.0-20141016 -> /Users/nblack/temp/test/node_modules/mocha-phantomjs/node_modules/phantomjs2/lib/phantom
Removing /var/folders/81/0crqt_td7nj1v7gwscvg9x9c0000gn/T/phantomjs/phantomjs-2.0.0-20141016-macosx.zip-extract-1436025934720
Writing location.js file
Done. Phantomjs binary available at /Users/nblack/temp/test/node_modules/mocha-phantomjs/node_modules/phantomjs2/lib/phantom/bin/phantomjs
mocha-phantomjs@4.0.0-beta1 node_modules/mocha-phantomjs
├── commander@2.8.1 (graceful-readlink@1.0.1)
├── mocha-phantomjs-core@0.2.1
└── phantomjs2@2.0.0 (which@1.0.9, progress@1.1.8, rimraf@2.2.8, kew@0.4.0, ncp@1.0.1, adm-zip@0.4.4, request-progress@0.3.1, mkdirp@0.5.0, npmconf@2.0.9, request@2.42.0)
nicolas-t commented 9 years ago

Hi there, I think I ran into some similar issue

$ npm install -g mocha-phantomjs
|
> phantomjs2@2.0.0 install C:\Users\nicolas\AppData\Roaming\npm\node_modules\mocha-phantomjs\node_modules\phant
omjs2
> node install.js

PhantomJS detected, but wrong version 1.9.8 @ c:\Program Files (x86)\PhantomJS\phantomjs.EXE.
Unexpected platform or architecture: win32 x64
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli
.js" "install" "-g" "mocha-phantomjs"
npm ERR! node v0.12.4
npm ERR! npm  v2.10.1
npm ERR! code ELIFECYCLE

npm ERR! phantomjs2@2.0.0 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phantomjs2@2.0.0 install script 'node install.js'.

Even if I have an older version (1.9.8) it still tries to install phantomJS2 and fails.

it worked with npm install -g https://github.com/metaskills/mocha-phantomjs/archive/v3.5.3.tar.gz thanks @socketwiz

nathanboktae commented 9 years ago

Can you guys share your ~/npmrc file ? For some reason your npm is choosing a beta package. Tl;Dr phantomjs2 has no official binaries for Linux so the install is failing.

nicolas-t commented 9 years ago

I don't have one (?)
(windows 7)

socketwiz commented 9 years ago

I don't have one either, centos v6.6

socketwiz commented 9 years ago

I tried this on my mac, where I also don't have an ~/npmrc and it works there, but only because it seems the phantomjs2 binary is available for mac. And you're right, this it is installing 4.0.0-beta1, but why is the broken beta the default, why not make the default a stable release?

Rickys-Mac-Pro.local ➜  bin git:(master) ✗ cat ~/npmrc
cat: /Users/socketwiz/npmrc: No such file or directory
Rickys-Mac-Pro.local ➜  bin git:(master) ✗ npm install -g mocha-phantomjs
-
> phantomjs2@2.0.0 install /usr/local/lib/node_modules/mocha-phantomjs/node_modules/phantomjs2
> node install.js

Downloading https://github.com/bprodoehl/phantomjs/releases/download/2.0.0-20141016/phantomjs-2.0.0-20141016-macosx.zip
Saving to /var/folders/n1/t4bzvjv50cq9zqcdmzx9nv6w0000gn/T/phantomjs/phantomjs-2.0.0-20141016-macosx.zip
Receiving...
  [================================--------] 80% 0.0s
Received 17340K total.
Extracting zip contents
Removing /usr/local/lib/node_modules/mocha-phantomjs/node_modules/phantomjs2/lib/phantom
Copying extracted folder /var/folders/n1/t4bzvjv50cq9zqcdmzx9nv6w0000gn/T/phantomjs/phantomjs-2.0.0-20141016-macosx.zip-extract-1436266136828/phantomjs-2.0.0-20141016 -> /usr/local/lib/node_modules/mocha-phantomjs/node_modules/phantomjs2/lib/phantom
Removing /var/folders/n1/t4bzvjv50cq9zqcdmzx9nv6w0000gn/T/phantomjs/phantomjs-2.0.0-20141016-macosx.zip-extract-1436266136828
Writing location.js file
Done. Phantomjs binary available at /usr/local/lib/node_modules/mocha-phantomjs/node_modules/phantomjs2/lib/phantom/bin/phantomjs
/usr/local/bin/mocha-phantomjs -> /usr/local/lib/node_modules/mocha-phantomjs/bin/mocha-phantomjs
mocha-phantomjs@4.0.0-beta1 /usr/local/lib/node_modules/mocha-phantomjs
├── commander@2.8.1 (graceful-readlink@1.0.1)
├── mocha-phantomjs-core@0.2.1
└── phantomjs2@2.0.0 (which@1.0.9, progress@1.1.8, rimraf@2.2.8, ncp@1.0.1, kew@0.4.0, request-progress@0.3.1, adm-zip@0.4.4, mkdirp@0.5.0, npmconf@2.0.9, request@2.42.0)
Rickys-Mac-Pro.local ➜  bin git:(master) ✗ mocha-phantomjs --version
4.0.0-beta1
nathanboktae commented 9 years ago

I've unpublished 4.0.0-beta1. Anyone that was depending on this, please install via the github tag v4.0.0-beta1 or branch v4.