【问题标题】:Why Eslint Plugins is found locally but I cannot build on the server?为什么 Eslint 插件在本地找到,但我无法在服务器上构建?
【发布时间】:2021-05-01 14:36:26
【问题描述】:

构建服务器上的 ESlint 命令失败并出现错误:

ESLint couldn't find the plugin "@typescript-eslint/eslint-plugin".

然而,一切都在本地完美运行。服务端没有全局 eslint 命令,所以它执行 Package.json 中定义的 Dev Dependency

.eslintrc

"extends": [
    "eslint:recommended",
    "plugin:@typescript-eslint/eslint-recommended",
    "plugin:@typescript-eslint/recommended"
  ],
  "parser": "@typescript-eslint/parser",

包.json

 "@typescript-eslint/eslint-plugin": "^4.14.1",
 "@typescript-eslint/parser": "^4.13.0",
"eslint": "^7.18.0",

【问题讨论】:

  • 你在服务器上运行 npm install 了吗?
  • @Alex 谢谢你问我是的 :(

标签: node.js typescript npm eslint


【解决方案1】:

问题已通过添加解决

"root": true,

.eslintrc 文件

【讨论】:

    猜你喜欢
    • 2014-05-10
    • 1970-01-01
    • 2020-02-14
    • 1970-01-01
    • 2012-02-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-07
    相关资源
    最近更新 更多