【问题标题】:ES lint init setup not shown VS Code Windows OSESlint 初始化设置未显示 VSCode Windows 操作系统
【发布时间】:2020-09-18 18:36:17
【问题描述】:

我尝试在 VS Code IDE 中设置 Eslint,但是在安装了 eslint 依赖项后, 然后通过$ npm install eslint --save-dev 命令 执行以下命令进行配置

$ ./node_modules/.bin/eslint --init

得到以下错误,是什么问题?

eslint : 文件 \AppData\Roaming\npm\eslint.ps1 不能 加载,因为在此系统上禁用了正在运行的脚本。更多 信息,请参阅 about_Execution_Policies,网址为 https://go.microsoft.com/fwlink/?LinkID=135170。在行:1 字符:1 + eslint --init +~~~~~~ + CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess

【问题讨论】:

    标签: javascript windows visual-studio-code configuration eslint


    【解决方案1】:

    在你的powershell中你可能需要执行

    Set-ExecutionPolicy RemoteSigned
    

    试试

    npx eslint --init
    

    还有

    的输出是什么
    npm run eslint --init
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-12-02
    • 2013-05-05
    • 2016-12-25
    • 2012-11-13
    • 2022-11-17
    • 2018-06-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多