ember-simple-auth with ember-cli - authentication

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.

Related

Vue CLI: What exactly happens when I use "npm install"?

I've been using the command line for some time now, but I'm still not sure what exactly happens when I do certain things - and I'm not sure what to google for help.
When I'm working with Anaconda and Python, I found the environments I created in C:\Users\<User>\Anaconda3\envs. And every python package I install in an environment seems to go there. Great!
But how does this work outside of Anaconda/Python? For example, I installed the vue CLI via npm install -g #vue/cli. What exactly happens when I do this; or more precicely, where are files saved?
During the creation of a new vue project, a readme.md is created as well. It states that users should simply npm install to setup the project. It seems that this command installs all packages stated in the package.json. I would like to try out if this command works for new users, but I already (obviously) have everything installed. Can I create some kind of environment (like I do with Anaconda for Python) to accomplish this?
Thanks a lot for your answers!

Would it be possible to follow tutorials that use vue-cli but with CLI 3?

I have just started learning Vue.js. The author is using npm install -g vue-cli but it did not work with me because I got stuck with technical issues and I tried many solutions to fix it but I couldn't.
So I want to follow up with the author but using npm install -g #vue/cli. So Do you think I it will be easy to follow up with him? I mean are these different versions use different syntax?
The vue-cli package seems to be the old cli. The main difference between this version and Vue CLI 3 is that the webpack configuration used to be visible in the project as a build directory. To make changes to the build process you used to have to modify files within this folder. In Vue CLI 3 this has been moved to a helper that consumes a configuration file vue.config.js in the project. The structure of files has been slightly altered in this version of the CLI. Both work with Vue 2.x, so the way you write .vue files has not changed in any way.
Overall you should have little trouble following the tutorial, unless you are going to make changes to the build process. In that case, simply consult the official documentation or find a tutorial that is specifically for Vue CLI 3.

I need a bower alternative

I am working on a project with dotnet core, in Linux and it is using MVC.
I am reading a book for learning how to put things together. The book advises installing Bower. But the last time I researched bower I believe they were advising towards using something else for new projects.
I would like to know what alternative I can use for front end management. I need to be able to use Bootstrap, Jquery, Popper and Datatables on my page. And of course, I should be able to use it in Linux.
Thanks for the help francium. NPM is working just fine.It is in the official Ubuntu repository. You have to install popper the following way though: npm install popper.js --save
If you don't specify the .js extension it will give you a warning saying that bootstrap requires a popper installation but it was not installed. You also have to install git on your machine to make it work. I did not do it the first time I ran it and it gave me an error asking me if it was installed. Thanks for the suggestion, It was relatively easy to do get things working.
Yarn is now the alternative to Bower, but to install Yarn you need to use NPM

Ember: error while i am running ember serve

I am try to upgrade exisiting ember project cli version by following this tutorial
https://emberigniter.com/update-latest-ember-data-cli/
after finishing this i try to run ember serve it shows error like
missing path
i doknow what exactly it was trying to say and also i am new to ember could any one help me sort out this issue.
I recommend using ember-cli-update to update your ember projects. Please check it out. It avoids user-mistakes while upgrading (no manual merges, etc. ...).
You could try to delete node_modules and run npm install again. It could a package in your package.json that ember serve can't find. Also check the releases it is not easy to upgrade from older version to the latest one, too many deprecations. Also if it si too old i suggest you to start over create again the ember app.

Creating an aurelia custom element as an npm package (using the Aurelia CLI)

I am using the Aurelia CLI for creating a SPA and it makes everything a lot easier compared to using Jspm.
However now we have some custom elements like: <my-custom-element></my-custom-element> that we want to package into an npm package so we can use it in multiple/other Aurelia CLI projects.
How would I go about creating it? I can't find any examples or documentation about this.
My guess is that I need to transpile my custom element files so that I end up with an npm package containing .js files (we use typescript) and the correct module loader synax (CommonJS?)?
My understanding is that I can't simply create an npm package that contains my my-custom.element.ts + my-custom-element.html file since it all needs to be transpiled, bundled and so on.
I am also guessing that I can't simply do an au build and use my bundles since that would bundle the entire SPA and not just my custom element files?
So what steps do I need to perform to create an npm package that contains a custom element that can be added to my Aurelia CLI project?
Any help or samples would be very welcome! Thank you!
There are a heap of ways you can do this. However, to keep things simple I am going to recommend the official Aurelia plugin skeleton for developing plugins, which you can get on Github here. If you venture into the src folder, you'll see a very basic example of a custom element and how you can make it global. The plugin skeleton uses Gulp for build tasks, which can be found in the build/tasks directory.
At present, you cannot use the Aurelia CLI to create a plugin. But in the future, you will most likely see this feature added into the CLI as it becomes more than just a CLI for creating applications.