简体   繁体   中英

ember-simple-auth with ember-cli

Trying to follow the instructions for using ember-simple-auth with ember-cli here:

http://ember-simple-auth.simplabs.com/

At the start it says to do :

 npm install --save-dev ember-cli-simple-auth ember generate ember-cli-simple-auth 

But as soon as I try that 'ember generate' I get the following error:

The `ember generate` command requires an entity name to be specified. For more details, use `ember help`.

So it looks like that ember generate command isn't right... anyone able to help? Am I to generate an initialiser or something?

Thanks

Two things were needed to sort this out.

Firstly to upgrade the version of ember-cli

This is covered here:

http://www.ember-cli.com/#upgrading-an-ember-cli-app

Use NPM to update to the latest released version of Ember CLI.

npm install --save-dev ember-cli

When you update to the latest version you may need to re-install files from the app blueprint and update Node NPM dependencies.

ember init

This will re-copy files from the project blueprint. You can choose to overwrite existing files or not. It will subsequently call npm install to update any changed dependencies.

And Secondly , needed to find the updated blog instructions for ember-simple-auth:

http://log.simplabs.com/post/90339547725/using-ember-simple-auth-with-ember-cli

which don't include the generate command now.

Typically the blueprints the generators use, require the following syntax: ember generate <blueprint> <name>

I would expect the usage of simple-auth to follow the convention and you would do something like

ember generate ember-cli-simple-auth <your new route name>

Ember simple auth and ember cli simple auth are two slightly different things. On the ember simple auth page https://github.com/simplabs/ember-simple-auth#ember-cli it says

If you're using Ember CLI, just add the ember-cli-simple-auth Ember CLI Addon to your project and Ember Simple Auth will setup itself.

which means to do what you are doing you need the ember-cli-simple-auth add on - found here https://github.com/simplabs/ember-cli-simple-auth

The way to install that is how youve described above.

Ember simple auth has gone through a lot of changes in its time so the page you are getting your instructions from might not be the most up to date. Github is usually the best place to check for solutions to packages if you are having difficulties as the most up to date documentation will most liekly be there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM