【问题标题】:VScode cannot be loaded because running scripts is disabled on this system无法加载 VScode,因为在此系统上禁用了运行脚本
【发布时间】:2021-02-22 07:43:46
【问题描述】:
jshint : File C:\Users\Balarka\AppData\Roaming\npm\jshint.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
+ jshint app.js
+ ~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

【问题讨论】:

标签: visual-studio-code vscode-settings vscode-remote


【解决方案1】:

这里引用了一个答案:https://stackoverflow.com/a/59244943/11518388

或者,您还可以编辑 Visual Studio Code 的属性(右键单击快捷方式,单击属性)并强制它始终以管理员身份运行。

【讨论】:

    【解决方案2】:

    你可以使用:

    Set-ExecutionPolicy -ExecutionPolicy Undefined -Scope LocalMachine
    

    或:

    Set-ExecutionPolicy -ExecutionPolicy Undefined -Scope CurrentUser
    

    您应该以管理员身份输入这些命令。

    【讨论】:

    • 我建议您添加一些关于这些命令的作用的上下文,尤其是“未定义”执行策略的含义。
    • 请在您的回答中提供更多详细信息。正如目前所写的那样,很难理解您的解决方案。
    猜你喜欢
    • 2020-06-20
    • 2021-10-27
    • 2017-04-28
    • 2020-03-06
    • 2013-05-03
    • 2013-10-06
    • 2019-10-05
    • 2022-10-25
    • 2020-03-11
    相关资源
    最近更新 更多