'when i type command at windows terminal http-server
when i type command at windows terminal http-server following error occured
error
http-server
http-server : File C:\Users\RKanth\AppData\Roaming\npm\http-server.ps1 cannot be
loaded because running scripts is disabled on this system. For more information, see
about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ http-server
+ ~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
Solution 1:[1]
Open PowerShell by Run as Administrator
Run the following command:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachineConfirm with ‘Y’
Solution 2:[2]
- Open PowerShell by Running as Administrator using the windows search bar.
- Run the following command:
Get-ExecutionPolicy - Then you can See:
Restricted - Again run the following command:
Set-ExecutionPolicy Unrestrict - Press y
- Now you can Run again the following command and check:
Get-ExecutionPolicy - Then you can See:
Unrestricted - Done!!!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Adrian Mole |
| Solution 2 | Malintha Nilhan |
