问题
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!!!
回答1:
Just try to open Windows PowerShell run as administrator and then run this command line: Set-ExecutionPolicy RemoteSigned
回答2:
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
来源:https://stackoverflow.com/questions/60410285/expo-version-command-shows-running-scripts-disabled-on-this-machine