Could not find ember-validations module

Trying to use the ember-validations plugin for ember-cli. Beat with this problem that I cannot understand what is missing.

Here is part of the dependencies in my package. json:

"devDependencies": { "broccoli-asset-rev": "^2.0.0", "broccoli-ember-hbs-template-compiler": "^1.6.1", "ember-cli": "0.1.9", "ember-cli-6to5": "0.2.1", "ember-cli-content-security-policy": "0.3.0", "ember-cli-dependency-checker": "0.0.7", "ember-cli-ic-ajax": "0.1.1", "ember-cli-inject-live-reload": "^1.3.0", "ember-cli-qunit": "0.1.2", "ember-data": "1.0.0-beta.12", "ember-export-application-global": "^1.0.0", "express": "^4.8.5", "glob": "^4.0.5", "ember-validations": "~2.0.0-alpha.2" //Also tried with "~ 2.0.0" as advised in the guide } 

And a simple controller that looks like this:

 import Ember from 'ember'; import EmberValidations from 'ember-validations'; export default Ember.Controller.extend(EmberValidations.Mixin, { actions: { //.... }, validations: { mailid: { presence: true }, password: { presence: true } } }); 

And bower.json:

 { "name": "ahem", "dependencies": { "handlebars": "~1.3.0", "jquery": "^1.11.1", "ember": "1.8.1", "ember-data": "1.0.0-beta.12", "ember-resolver": "~0.1.11", "loader.js": "ember-cli/loader.js#1.0.1", "ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3", "ember-cli-test-loader": "rwjblue/ember-cli-test-loader#0.0.4", "ember-load-initializers": "ember-cli/ember-load-initializers#0.0.2", "ember-qunit": "0.1.8", "ember-qunit-notifications": "0.0.5", "qunit": "~1.17.1", "bootstrap": "~3.3.2" } } 

But when viewing the route in the browser, an error message appears in the console:

 Could not find module ember-validations 

Not sure what I'm doing wrong. Any help was appreciated.

+2
source share
2 answers

The package seems to be looking for a module called ember-easyform-cli. So I suggest adding:

 ember-easyform-cli": "git://github.com/kristianmandrup/ember-easyform-cli.git#master" 

to the package.json file.

In addition, I noticed that there are 3 goals ["0.0.0", "2.0.0-alpha.1", "2.0.0-alpha.2"]. Try using version 2.0.0-alpha.1 instead of 2.0.0-alpha.2 by adding "ember-validations": "2.0.0-alpha.1" in package.json.

+2
source

I had the same problem after installing https://github.com/abpetkov/switchery and importing it through brocfile:

 app.import('bower_components/switchery/switchery.js'); 

switching to dist version allowed this for me

 app.import('bower_components/switchery/dist/switchery.js'); 

There may be some conflict between ember validations and other ember modules. Perhaps recycle your Brocfile or package.json and find the source of the problem through trial and error, or temporarily disable recently installed packages.

0
source

Source: https://habr.com/ru/post/1212111/


All Articles