Bledi
Bledi

Reputation: 35

expo cannot be loaded on terminal(npm run - works but not expo start)

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

Upvotes: 0

Views: 2853

Answers (1)

DToxVanilla
DToxVanilla

Reputation: 244

If you see this error follow these steps:

  1. Open Windows PowerShell with Run as Administrator.

  2. 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.

  3. 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

Related Questions