5

I am new to Angular so please help me. I have installed node.js and angular cli, also downloaded visual studio code and set environment variable as well. Now trying to create first ever project in Angular but it is not working and instead showing this error "cannot be loaded because running scripts is disabled on this system." Kindly help me to rectify the error. Also, I refereed to the link given about-execution-policies but couldn't understand what exactly to do. enter image description here

UPDATE: I got answer to it. Just need to type

cmd

in the address bar of the folder where the project is and then open VS code using

code .

It will run. Thanks to all for giving inputs and helping me out. Kudos to all.

Srija Nair
  • 219
  • 3
  • 12
  • I found an answer here : [link](https://stackoverflow.com/questions/56199111/visual-studio-code-cmd-error-cannot-be-loaded-because-running-scripts-is-disabl ) but it still throws an error. – Srija Nair May 17 '20 at 09:30

2 Answers2

7
  1. Navigate to your project directory via VSCode terminal.
  2. Type this command & press Enter.

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Sandun
  • 395
  • 2
  • 10
  • 25
3

VS Code use Powershell, so try to use Windows Terminal to create the Project or go to the path and delete the file ng.ps1 and tray it again.

  • Yes, thank you. Its working in node command prompt. Got able to create new project. Still how to set Powershell so that I can use VS Code. If you could help with that too. – Srija Nair May 17 '20 at 09:40
  • mhm,I don't remember exactly what I did. Here are a few memories I have from fixing the problem. - Delete the file ng.ps1 and then install Angular Cli with the Windows Terminal - VS Code shortcut (.exe) Set to start in admin mode so that Powershell will be started in admin mode. – Simon Steinbeisser May 17 '20 at 09:51