I am trying to develop a react native project in my Windows 10 machine. I installed node js then expo cli via visual studio code terminal. Then I tried the command expo --version
, the terminal shows error::
expo : File C:\Users\saka\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
+ expo --version
+ ~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
the given link shows many things, but what shall I do to solve my problem? Thank You!!!
ps1 cannot be loaded because running scripts is disabled on this system" occurs when the execution policy does not allow running the specific script on Windows. Use the Set-ExecutionPolicy -ExecutionPolicy RemoteSigned command to solve the error.
Just try to open Windows PowerShell run as administrator and then run this command line:
Set-ExecutionPolicy RemoteSigned
Step1 : start power shell in administrator mode.
Step2 : Type the following command "set-ExecutionPolicy RemoteSigned"
Step3: Press Y for your Confirmation.
Paste this code in your terminal
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted
Press Enter
Enjoy :)
Trying to run expo start command via the integrated terminal of visual studio IDE which is by default not authorized.
In such case you open the CMD and run it as an administrator and then type expo start
in the project directory. This will work.
For more information please visit this link
Step 1: You need to open your power shell or command line with ‘Run as Administrator’ by right-clicking on its icon.
Step 2: You need to type in the following command:
Set-ExecutionPolicy RemoteSigned
refer
Step 3: You will see the following message and permission request. Type ‘a’ and enter
refer
Solution 2:
Try running the following command in PowerShell after running as administrator.
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy unrestricted
Now go and tried installing and then running ‘Expo’
Solution 1:
Trying to run expo start command via the integrated terminal of visual studio IDE which is by default not authorized.
In such a case, you open the CMD and run it as an administrator mode and then type expo --version in the project directory. This will work.
Solution 2:
Try running the following command in PowerShell after running as administrator mode.
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy unrestricted type A Yes to All
Now go and tried installing and then running ‘Expo’
In case You are using Command Prompt follow this:
2: Run this command: powershell.exe Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy unrestricted
. Open Settings, and click/tap on the Update & security icon. 2. Click/tap on For developers on the left side, check the Change execution policy to allow local PowerShell scripts to run without signing. Require signing for remote scripts. box under PowerShell on the right side, and click/tap on the Apply button.
do this thing your problem must be solve if u r windows 10 user
100% Working
How to set PowerShell script execution policy within Visual Studio Code:
Open Settings, and click/tap on the Update & security icon. 2. Click/tap on For developers on the left side, check the Change execution policy to allow local PowerShell scripts to run without signing. Require signing for remote scripts. box under PowerShell on the right side, and click/tap on the Apply button.
do this thing your problem must be solve if u r windows 10 user
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With