nathanboktae / mocha-phantomjs

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

Broken for npm 2.0 / Semver 4 #196

Closed alexmingoia closed 9 years ago

alexmingoia commented 9 years ago

Prerelease peer dependencies do not satisfy semver@4. Trying to install this is broken using npm 2.0. Please update the dependencies to valid semver

nathanboktae commented 9 years ago

mocha-phantomjs doesn't have pre-release peer dependencies. You're misreading the range.

I just tested this and it works fine. Are you talking about npm 3?

~/github/mocha-phantomjs
11:48AM ᐅ which phantomjs
phantomjs not found

~/github/mocha-phantomjs
11:48AM ᐅ which mocha-phantomjs
mocha-phantomjs not found

~/github/mocha-phantomjs
11:48AM ᐅ npm --version
2.12.1

~/github/mocha-phantomjs
11:48AM ᐅ npm install -g mocha-phantomjs
npm WARN peerDependencies The peer dependency phantomjs@1.9.1 - 1.9.7-15 included from mocha-phantomjs will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
/usr/local/bin/mocha-phantomjs -> /usr/local/lib/node_modules/mocha-phantomjs/bin/mocha-phantomjs
/usr/local/bin/phantomjs -> /usr/local/lib/node_modules/phantomjs/bin/phantomjs

> phantomjs@1.9.7-15 install /usr/local/lib/node_modules/phantomjs
> 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-1.9.7-macosx.zip
Extracting zip contents
Copying extracted folder /var/folders/81/0crqt_td7nj1v7gwscvg9x9c0000gn/T/phantomjs/phantomjs-1.9.7-macosx.zip-extract-1437763721606/phantomjs-1.9.7-macosx -> /usr/local/lib/node_modules/phantomjs/lib/phantom
Writing location.js file
Done. Phantomjs binary available at /usr/local/lib/node_modules/phantomjs/lib/phantom/bin/phantomjs
phantomjs@1.9.7-15 /usr/local/lib/node_modules/phantomjs
├── which@1.0.9
├── progress@1.1.8
├── rimraf@2.2.8
├── kew@0.1.7
├── ncp@0.4.2
├── mkdirp@0.3.5
├── adm-zip@0.2.1
├── request-progress@0.3.1 (throttleit@0.0.2)
├── npmconf@0.0.24 (inherits@1.0.0, once@1.1.1, osenv@0.0.3, ini@1.1.0, semver@1.1.4, config-chain@1.1.9, nopt@2.2.1)
└── request@2.36.0 (forever-agent@0.5.2, aws-sign2@0.5.0, qs@0.6.6, oauth-sign@0.3.0, tunnel-agent@0.4.1, json-stringify-safe@5.0.1, mime@1.2.11, node-uuid@1.4.3, tough-cookie@2.0.0, http-signature@0.10.1, hawk@1.0.0, form-data@0.1.4)

mocha-phantomjs@3.6.0 /usr/local/lib/node_modules/mocha-phantomjs
├── commander@2.0.0
└── mocha@1.20.1 (diff@1.0.7, growl@1.7.0, mkdirp@0.3.5, jade@0.26.3, debug@2.2.0, glob@3.2.3)

~/github/mocha-phantomjs
11:48AM ᐅ phantomjs --version
1.9.7

~/github/mocha-phantomjs
11:49AM ᐅ mocha-phantomjs --version
3.6.0
alexmingoia commented 9 years ago

https://github.com/nathanboktae/mocha-phantomjs/blob/master/package.json#L38-L40 specifies 1.9.7-15 which is not a valid semver@4

nathanboktae commented 9 years ago

As you can see from above I'm using npm 2.12.1 and it's working, so please show me evidence.

I didn't choose the versioning for phantomjs unfortunately, and many, many users were running into #167, so I am very inclined not to change it. You can use @3.5.6 if it's blocking you - there's no difference between that and 3.6.0. 4.0 is ready to go too as soon as phantomjs 2.0 actually fully lands, and it will have a direct dependency on phantomjs@2

tbremer commented 9 years ago

Can confirm the same issue, dump from npm-debug.log here

screen shot 2015-07-27 at 1 36 52 am

I am running iojs and nam 2.11.0

$ node --version
v2.2.1
$ npm --version
2.11.0
nathanboktae commented 9 years ago

That log is way too verbose but its likely not the same issue. You probably have something else specificing a different mocha-phantomjs range. What is your deps in your package.json?

tbremer commented 9 years ago

@nathanboktae you were right, sorry! I didn't realize there was a version dependency.

osukaa commented 9 years ago

I can't seem to fix this issue and I already checked all of my project dependencies :s

Here's part of my log

125 verbose validateInstall loading /Users/coca/Documents/repos/hapi-maintainer/tv/package.json for validation
126 verbose stack Error: The package phantomjs does not satisfy its siblings' peerDependencies requirements!
126 verbose stack     at /usr/local/lib/node_modules/npm/lib/install.js:125:32
126 verbose stack     at /usr/local/lib/node_modules/npm/lib/install.js:267:7
126 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/read-installed/read-installed.js:138:5
126 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/read-installed/read-installed.js:251:14
126 verbose stack     at cb (/usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:47:24)
126 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/read-installed/read-installed.js:251:14
126 verbose stack     at cb (/usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:47:24)
126 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/read-installed/read-installed.js:251:14
126 verbose stack     at cb (/usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:47:24)
126 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/read-installed/read-installed.js:251:14
127 verbose cwd /Users/coca/Documents/repos/hapi-maintainer/tv
128 error Darwin 13.4.0
129 error argv "node" "/usr/local/bin/npm" "install"
130 error node v0.12.6
131 error npm  v2.11.2
132 error code EPEERINVALID
133 error peerinvalid The package phantomjs does not satisfy its siblings' peerDependencies requirements!
133 error peerinvalid Peer mocha-phantomjs@3.6.0 wants phantomjs@1.9.1 - 1.9.7-15
134 verbose exit [ 1, true ]
tbremer commented 9 years ago

@osukaa, my issue was related to a phantomjs declaration in my package.json. I removed declaring a version there and let mocha-phantom do its thing.

{
…
"devDependencies": {
    "chai": "^3.2.0",
    "docco": "^0.7.0",
    "eslint": "^0.24.1",
    "gulp": "^3.9.0",
    "gulp-babel": "^5.1.0",
    "gulp-clean": "^0.3.1",
    "gulp-concat": "^2.6.0",
    "gulp-docco": "0.0.4",
    "gulp-mocha-phantomjs": "^0.8.1",
    "gulp-uglify": "^1.2.0",
    "gulp-webserver": "^0.9.1",
    "mocha": "^2.2.5",
    "mocha-phantomjs": "^3.6.0"
  },
…
}

There was however this warning:

npm WARN peerDependencies The peer dependency phantomjs@1.9.1 - 1.9.7-15 included from mocha-phantomjs will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.

which could be an issue down the road.

nathanboktae commented 9 years ago

The other option is declare it but satisfy the range, e.g. "phantomjs": "1.9.7-15"

which could be an issue down the road.

V4 will use direct dependencies, so we'll be avoiding all this mess soon.

osukaa commented 9 years ago

That's what I ended up doing, setting that specific version of PhantomJS. Thanks!

— Sent from Mailbox

On Thu, Jul 30, 2015 at 5:36 PM, Nathan Black notifications@github.com wrote:

The other option is declare it but satisfy the range, e.g. "phantomjs": "1.9.7-15"

which could be an issue down the road.

V4 will use direct dependencies, so we'll be avoiding all this mess soon.

Reply to this email directly or view it on GitHub: https://github.com/nathanboktae/mocha-phantomjs/issues/196#issuecomment-126521622

tbremer commented 9 years ago

Thanks @nathanboktae this is a great package!