How to run angular 2 application? - angular2-routing

I have downloaded angular 2 application from this link:
https://github.com/aravindfz/firstAngular2App
How to run this application?
Which angular cli version install to run angular 2 application?
I tried from some questions stackoverflow but not working properly.guys this question is not duplicate..Please understand.
Anyone can give clear details?
I need step by step procedure.

If you cloned the repo and did nothing else, there are a few things you need to do before you can run the app. Since I don't know how much web development you have done, I'm going to include things some people will think unnecessary.
Install node.js, if you haven't yet. Grab the LTS release from https://nodejs.org/en/. Do not use the "Current" version, because that may not be compatible with Angular just yet. If you have and older version of Node, upgrade. If you already have the LTS version, skip this step.
Now open a new command prompt or terminal and change to the directory where you cloned the repo. To be sure you're in the right place, make sure you can see a file named package.json.
In this command prompt/terminal window, execute this command: npm install. This will download and install all the dependencies (which could rather disturbingly add up to a few hundred Megabytes). You may experience timeout errors if you're behind a corporate proxy server. That's not something you can fix as of 2018. Just connect using something else and try again.
Once everything is installed, you should be able to run the Angular app. Everything I mentioned already only need to be done before you run it the first time. To ensure you are in the right folder, navigate to where your index.html is located and run this command: ng serve. If ng cannot be found, you may need to install it. To do so, execute npm install --save-dev #angular/cli. Now it should work. If not, close your command prompt/terminal window, open a new one and try ng serve again.
Once ng serve is finished compiling, you should be able to view your app by opening http://localhost:4200 in your favourite browser.
And that's it!
Here's a bonus tip: Take the time to work through the official Angular Quick Start. It really is a fantastic guide and will get you skilled up much quicker than just hacking it ever will.
Good luck.

Related

Heroku isn't updating my CSS and JS

First thing I should mention is that I'm NOT using Rails. I don't have a rake assets:precompile task (tried it anyway, didn't work). I don't have a public/assets folder either (tried git rm -r public/assets anyway, also didn't work).
For a long time, I was using Dropbox to deploy to Heroku (I'm quite the newbie to code) - I was planning on moving to git in about a month or so. But given this issue, I made the move today and tried pushing through git - also didn't work. i.e. I did a git pull, settled all the conflicts and then did git push. Still nothing.
Basically, Heroku isn't loading any of my new CSS and JS. It detects the files just fine. Running git push now says everything is up-to-date, running git status says there is nothing to commit. But using Chrome's inspect tool, the JS and CSS files don't have the new code I wrote.
I also tried adding the gem rack-flash-session to my Gemfile and requiring 'rack/flash/test' in my application_controller - this actually crashed the whole app and I removed it.
I also tried installing the heroku-repo plugin and running heroku repo:purge_cache --app my-app-name but that also didn't work
Running the code locally, everything works fine. It's just the online version that's failing.
I updated the Heroku CLI just before trying any of this and (you guessed it!), also didn't work.
I don't know what other info you'd need, so let me know in the comments and I'll be happy to provide them :)
Any help is appreciated!
Refresh the page with control + shift + r. This will clear the client-side assets cache and get the newly updated ones. You could also look for a gem that does cache-busting "asset fingerprinting" - this is a unique string that's appended to the asset files which prevents browsers from using a stale copy. I searched a little but I can't definitively point you to something that works with sinatra. Maybe you'll be able to find a gem that works though.

Meteor error - promise.js

I have a reoccuring problem with my meteor applications that has caused me to delete and redo all my projects. The problem is that whenever I go to start up my app with meteor run or meteor it shows this error:
I had this problem with another one of my app and it required me to uninstall meteor and reinstall it for it to work..I was wondering if there was any other way to fix this problem. Many people have said delete you .meteor folder or .meteor/local folder and start it up again but that has not worked for me. Another solution that has worked for many people except me is the command that you run inside your application rm -rf ./.meteor but I have no luck with that. I don't know what to do at this point in terms of fixing my problem. and I do not have a problem with my code, as it was working about 2 days ago and I haven't touched it since.
I have:
Windows 10 Pro.
64 bit operating system(I don't know if that matters).
Meteor v1.5
Stuart,
Deleting the .meteor folder isn't a good idea, because it contains the list of packages, and your project won't work at all then.
You can delete .meteor/local, because that is basically its temporary build area. Another thing you can do it delete the node_modules folder, or type npm rebuild which tells npm to rebuild the node_modules directory in case there is some corruption in there.
meteor reset will clear out your database in case that is the problem.
You can delete~/.meteor, where ~ is your home directory. Meteor will rebuild it.
As for the screen shot, it's better if you can paste the actual text here, because I can't tell what that character is it's complaining about. Remember to click the button with the braces to format it correctly.
Hopefully one of the above will help you. Otherwise perhaps you could share the project?

Meteor 1.4.2.3 for Windows. Stuck at “Starting your app”

I've installed the latest version of meteor 1.4.2.3 and simply trying to create my first meteor app. The steps are simple but the process keeps looping on "Starting your app".
I've searched for solutions and tried the following with no success: meteor update, changing the port, npm install, meteor reset, uninstall and reinstall.
Stuck at "Starting you app" seems to be a common issue with no consensus on solution.
Please someone help!
Meteor needs quite a bit of memory, if you have less than 8GB it will struggle.
Sometimes just control-c it and starting it again works.
Sometimes it needs a
meteor reset
Another thing you can do is remove
<project-dir>/.meteor/local
Usually the problem only rears its head once in a while
I met this issue too. And Meteor stuck suddenly, it was working fine a day before. I tried everything. Uninstalling,reseting meteor, updating meteor, updating npm, meteor npm cache clean,Registry editing etc. Nothing helped. Then,
I updated my Windows 8.1 to Windows 10 and it was working again.
Edit: try this method first.
https://stackoverflow.com/a/46133529/3959840
I just downloaded meteor for Windows V 1.5.2. In my case I did not have Mongo DB installed.
I downloaded it from here and in cmd I set the MONGO_URL=' ' and boom it started my app.
Hope this helps someone :).

Meteor instability

I am learning meteor to build an app. I am finding things pretty unstable with Meteor. I am using Ubuntu 14.04 and Meteor 1.0.3
Everything is working fine and I had finished couple of Modules. And Suddenly one day, I get this error:
Can't find npm module 'mailcomposer'. Did you forget to call 'Npm.depends' in package.js within the 'email' package?
I know that 'mailcomposer' package is not there and installed it and worked well.
And again, projects work fine and again one day suddenly I get this error:
Cannot find module 'fibers'.
I really want to know what is happening. I have not removed any module nor did I add one. My project was running fine, but later when I opened the system I got the error. Does meteor remove or update modules automatically in the backend? Rather than fixing these errors, I want to know why modules are suddenly being removed.
I am novice in Meteor, apologies if the question is stupid.
I had this issue when I was deploying an Meteor app on Digital Ocean, for some reason I had to reinstall nodejs and fibers package to make it work again.
Are you switching from 1 node version to another?
If you are on the server:
get meteor's node version meteor node -v
verify if the server is using the same node version by node -v
Let me know...

Meteor compile errors

I checked out 86a52e6 on the master branch from the Meteor repo. Ran ./scripts/generate-dev-bundle.sh per the Slow Start (for developers) instructions. This goes off to work for awhile, generating a ton of output but ending with errors. All of them seem to be unused private fields in third-party libraries.
Has anyone seen anything like this? Any guidance would be most welcome! I've been getting to know my way around Meteor via the pre-compiled binaries, but this was my first attempt to build from scratch.
Running OSX 10.8.5.
Thanks in advance!
You don't need to compile your own dev_bundle. On first time you run meteor from the checkout, it will download compiled binaries (mongod, mongo, node and npm) for your system architecture.
Don't bother yourself compiling, just use ready binaries.

Resources