expo version command shows running scripts disabled on this machine

喜欢而已 提交于 2020-05-08 06:02:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!