On sunning the npm scripts in the Visual Studio code you may face an error saying:
ng : ~\npm\ng.ps1 cannot be loaded because running scripts is disabled on this system.
This happens as your system, power shell is not yet allowed to execute any executable scripts. This error is encountered mainly in Windows 10 when using VS Code IDE where Power Shell is selected as a command-line option by default.
Step 1) Execute the following CMD command in the same Powershell terminal
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
You can check more details here. As a quick solution, we’re allowing for Current User.
Step 2) This is a very important step, make sure you close all CMD and VS Code instances to reflect the changes.
That’s it …. you are done 🙂