Angular upgrade 9 to 10

Current:

ng version
Angular CLI: 9.1.12
Node: 14.9.0
OS: win32 x64
Angular: 9.1.12
… animations, cli, common, compiler, compiler-cli, core, forms
… language-service, localize, platform-browser
… platform-browser-dynamic, router
Ivy Workspace: Yes

Out of the blue, PowerShell on executing “ng version” complains with:

ng : AppData\Roaming\npm\ng.ps1 cannot be loaded because running scripts is disabled on this system

Therefore check execution policy:

Get-ExecutionPolicy
Restricted

Solution, run PowerShell in admin mode and increase permissions:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Get-ExecutionPolicy -List
Scope ExecutionPolicy ----- ---------------
MachinePolicy Undefined
UserPolicy Undefined
Process Undefined
CurrentUser RemoteSigned
LocalMachine Restricted

The RemoteSigned policy does not seem without security risks but I am unable to find advisories on this topic.

Tip from this article, update not only local version but also global version of Angular:

npm uninstall -g @angular-cli
npm install -g @angular/cli@latest

and then local:

ng update @angular/cli @angular/core

First attempt fails with

Package "@ngx-i18nsupport/tooling" has an incompatible peer dependency to "@angular/common

Try again with force:

ng update --force @angular/cli @angular/core

Production update as before, no surprises. For code changes see Github.

Reading list

Create your own website, free on WordPress.com.Create your own website.
Start free