visual studio code – Angular, ng, npm and VSC commands

On one of my project I’d like to upgrade Angular version.
On Visual Studio Code, if I type “ng upgrade…” I get this error:

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

Same thing for every Angular command.

For let my project start I use “npm start”, wich I know it uses package.json, where I got this:

  "scripts": {
    "ng": "ng",
    "start": "ng serve",

Now, I know I can install Angular globally with the command

npm install -g @angular/cli

But if I do it, I’m afraid with “ng upgrade…” I’ll upgrade the global Angular version, not the Angular version in my app.

Once I used to edit manually my angular version on package.json and run “npm i”.

So, my question is: is there a “cleaner” way to do upgrade my Angular version only in my project? Any best practices?

Thanks!

Read more here: Source link