quaertym / ember-cli-dependency-checker

Ember CLI addon for checking missing node and bower dependencies before running ember commands
MIT License
40 stars 38 forks source link

Checker does not follow node-semver rules for beta versions #19

Closed indirect closed 9 years ago

indirect commented 9 years ago

My package.json contains this line: "ember-cli-sass": "^3.0.3",. Trying to run ember build results in this message:

Missing npm packages: 
Package: ember-cli-sass
  * Specified: ^3.0.3
  * Installed: 3.1.0-beta

Run `npm install` to install missing dependencies.

According to the node-semver documentation about prereleases, version 3.1.0-beta does in fact satisfy the specifier ^3.0.3. Pretty sure it is right, because npm install installed version 3.1.0-beta. Please either follow the specifier rules used by the package managers or change the error message to explain why you don't follow them and how to fix the problem. The error message says to run npm install, and that is just flat out wrong.

quaertym commented 9 years ago

Well, this it the node console output:

> var semver = require('semver');
undefined
> semver.satisfies('3.1.0-beta', '^3.0.3')
false
> semver.satisfies('3.1.0', '^3.0.3')
true

This is using the last released version (4.2.0) of semver package. If you think this is a bug then submit an issue to semver package.

indirect commented 9 years ago

okay, fine, it doesn't satisfy semver, but that means your error message is completely wrong. npm install doesn't help at all.

On Tue, Jan 13, 2015 at 5:51 PM, Emre Unal notifications@github.com wrote:

Well, this it the node console output:

> var semver = require('semver');
undefined
> semver.satisfies('3.1.0-beta', '^3.0.3')
false
> semver.satisfies('3.1.0', '^3.0.3')
true

This is using the last released version(4.2.0) of semver package. If you think this is a bug then submit an issue to semver package.

Reply to this email directly or view it on GitHub: https://github.com/quaertym/ember-cli-dependency-checker/issues/19#issuecomment-69856702

quaertym commented 9 years ago

The message is there to make you aware of the situation. It is your responsibility as a developer to fix the problem. One way to fix it is targeting stable version without caret as 3.0.3. See this SO question for little more explanation.

indirect commented 9 years ago

The SO question you link to says that 3.1.0-beta does satisfy ^3.0.3. If NPM uses semver to install packages, why does dependency-checker disagree? If dependency-checker disagrees with NPM, why do you keep the error message that says "run npm install to fix this problem"?

indirect commented 9 years ago

If the point of this package has nothing to do with bower install or npm install, and instead simply checks to make sure that semver.satisfies always returns true, then please update the error messages to explain that.

quaertym commented 9 years ago

If you are really concerned about this, please submit an issue to NPM and bower and link back here. As I said before messaging will probably be fixed by https://github.com/quaertym/ember-cli-dependency-checker/issues/16