gpt4 book ai didi

模块未定义且进程未在 Visual Studio 代码中的 eslint 中定义

转载 作者:行者123 更新时间:2023-12-03 09:45:31 26 4
gpt4 key购买 nike

我已经在我的机器上安装了 eslint 并且我使用了 Visual Studio 代码
我有某些模块和流程要导出
当我尝试使用“模块”或“进程”时,它显示
它以前工作正常。

[eslint] 'module' is not defined. (no-undef)
[eslint] 'process' is not defined. (no-undef)

这是我的 .eslintrc.json
{

"env": {
"browser": true,
"amd": true

},
"parserOptions": {
"ecmaVersion": 6
},
"extends": "eslint:recommended",
"rules": {
"no-console": "off",
"indent": [
"error",
"tab"
],
"linebreak-style": [
"error",
"windows"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
]
}

}

我想删除这个错误

最佳答案

您可能正在尝试在节点环境中运行它。
env部分应如下所示:

"env": {
"browser": true,
"amd": true,
"node": true
},

关于模块未定义且进程未在 Visual Studio 代码中的 eslint 中定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49789177/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com