Reputation: 35
expo : File D:\Users*user*\AppData\Roaming\npm\expo.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
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
Upvotes: 0
Views: 2853
Reputation: 244
If you see this error follow these steps:
Open Windows PowerShell with Run as Administrator.
Use Get-ExecutionPolicy
on Windows PowerShell to see the execution policy.
Most probably there you would see (Restricted) this command. So, the main reason-running scripts on this system are Restricted.
Now we need to change this policy to allow the operation. Use this command to make it "Unrestricted":
Set-ExecutionPolicy Unrestricted
Here you will get a prompt message and you should press 'Y' to change from Restricted to Unrestricted.
To ensure, you may check the execution policy by Get-ExecutionPolicy
again.
The possible output should be (Unrestricted)
Now you can use the expo start
command on your machine.
Upvotes: 6