Angural 11 issues and its solutions while creating crud operation

Prem Murmu on 4/23/2021 4:59:55 AM

I  was trying to create crud operation on angular 11 first time. I am faced some issues where i stucked and later i found their solutions.

If you face issues like this while working on angular might help you out and save you time.


Error:

1. 

ng : The term 'ng' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was 
included, verify that the path is correct and try again.
At line:1 char:1
+ ng new my-crud-app --routing
+ ~~
    + CategoryInfo          : ObjectNotFound: (ng:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNot FoundException


Solutions:   

Above error shows that either angular/cli or angular platform variable not set up in you system. So for that you have to first check:

1. Correct Node installed on your system  ( check node version "  node -v "), if not installed install it (click)

2. Go to project folder and execute command:  npm install -g @angular/cli


Above tips will work fine. If not comment below.

2. 

ng : File C:\Users...ng.ps1 cannot be loaded because running scripts is disabled on this system. For more information
At line:1 char:1
+ ng new my-crud-app --routing
+ ~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess


Solutions:

Above error means there is problem with script execution policy, need to set proper scope and policy set to enable it.

As an Administrator, you can set the execution policy following command

in powershell window

Set-ExecutionPolicy RemoteSigned
in CMD window (open as admin mode)
powershell Set-ExecutionPolicy RemoteSigned


Above tips will work fine. If not comment below.


0 Comments on this post

Comments(0)||Login to Comments


InterServer Web Hosting and VPS
  • see more..