How to Install Angular CLI on MacOS M1/M2 | Create First Project on Angular CLI
HTML-код
- Опубликовано: 20 окт 2024
- This Video Tutorial shows you How to Install Angular CLI on your MacOS M1/M2 Machine And Set up your first Angular 15 Project using the Angular CLI.
We talk about how to use the the new command and the serve command to create this project and then ultimately run it.
Install NPM and NodeJS on MacOS - • How to Download and In...
Commands to Check for NPM and NodeJS -
npm --version
nodejs --version
Install Angular CLI -
sudo npm install -g @angular/cli
Command to Verify Angular -
ng version
Command to Create and Launch Angular Project -
ng new project-name
Launch Angular -
ng serve
ng serve --port=4400(To Specify Diff Port)
#angular #frontend
thank you! you were very helpful!
Very helpful! Exactly what I needed! Thanks!
Finally!!! Exactly what I needed!
Great Video, I have an issue at the moment creating components, if I run ng g c mycomponent I get "More than one module matches. Use the '--skip-import' option to skip importing the component into the closest module or use the module option to specify a module." and If I add --skip-import I get "Option "_name" is not defined."
I do all the steps until where I check the ng version it says the following: zsh: command not found: ng
Thanks buddy, I was missing the @
Very helpfull!!
Thank you so much
Hi, i am getting the 'zsh: command not found: ng' error.
For that error I have created a separate video on that topic, Kindly have a look
omg TY !!!
how the RAM of your macbook ?
Error: This command is not available when running the Angular CLI inside a workspace. i get this message
I have completed the process till installing angular cli
but it shows an error after ng new my-angular-project (ERESOLVE unable to resolve dependency tree)
You have dependency conflict (incorrect and potentially broken dependency) as it says, so try to run the command with --force, or --legacy-peer-deps. If it doesn't take effect, the temporary solution is using prior versions of the Node.js (downgrading the Node.js version) as it causes this kind of errors to happen sometimes.
use: sudo while creating a new project.
I get this same error, how did you resolve it? I am trying sudo, its taking very long, not sure if its a good idea
Nice video, but I am facing this issue when i run ng serve on the terminal
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:71:19)
at Object.createHash (node:crypto:133:10)
Are you running ng serve on your mac terminal or vs code’s console
use sudo ng serve
Great video! However, I did exactly what you did and it says " zsh: command not found: ng" when I run ng --version on the terminal. What should I do?
OK, You can Resolve the Issue using these steps -
1. Linking angular/cli with npm
This can be done using the command,
npm link @angular/cli
2. Setting the location of npm folder
export PATH="$HOME/.npm-global/bin:$PATH"
or
export PATH="$HOME/.npm-packages/bin:$PATH"
3. Clearing cache and Re-installing Angular (Least Recommended)
In this case, you may need to uninstall angular from your machine with the command
npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/cli
@@prashantrana546 I have exactly the same issue and I tried 1 and 2! 2 works!!!!! You are a lifesaver!!! THANK YOU!!! But now how can I downgrade node.js ... so my ng could work lol
@@prashantrana546 do I have to use "export PATH="$HOME/.npm-global/bin:$PATH" everytime when I use "ng"? Thank you!
@@mintSadie You wanted to Downgrade Node Version, Can you update both Angular and Node to the Current LTS, will that be an issue?
If not Let me know.
@@prashantrana546 Thanks for your quick response! Yes I downgraded Node and it works! but when I use "ng" it said not found again unless I use the PATH
first time using mac os, how can i make text bigger? 0:50
Text Bigger? Mac Text in Terminal or Specific App
@@prashantrana546 terminal
In my mac I am unable to write password
when it shows password just type it, it wont be visible to you