简体   繁体   English

为什么 Eslint 插件在本地找到,但我无法在服务器上构建?

[英]Why Eslint Plugins is found locally but I cannot build on the server?

ESlint command on building server is failing with error:构建服务器上的 ESlint 命令失败并出现错误:

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

Whereas, everything is working perfectly locally.然而,一切都在本地完美运行。 There is no global eslint command on the server so it executes the Dev Dependency defined in Package.json服务器上没有全局 eslint 命令,因此它执行 Package.json 中定义的 Dev Dependency

.eslintrc .eslintrc

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

Package.json Package.json

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

The issue has been solve by adding该问题已通过添加解决

"root": true,

To .eslintrc file.eslintrc文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用本地eslint插件来使用本地安装的eslint - How to get local eslint plugins to work with locally installed eslint 找不到用于 CircleCI 构建的 ESLint - ESLint not found for CircleCI build 为什么在尝试使用eslint nodejs api时未应用eslint插件? - Why eslint plugins are not applied when I am trying to use eslint nodejs api? 命令 eslint --init 未找到,为什么? - Command eslint --init not found, why? 嵌套构建在管道中失败:找不到在本地构建时可以找到的模块 - Nest build fails in pipeline: Cannot find modules which can be found when building locally 无法使用远程服务器进行本地身份验证 - Cannot authenticate locally with remote server 为什么我收到错误 [ERR_MODULE_NOT_FOUND]:运行服务器时找不到模块 - Why I'm getting Error [ERR_MODULE_NOT_FOUND]: Cannot find module when running the server 为什么 heroku 我的构建失败并说它在本地工作时找不到文件? - Why does heroku fail my build and says it cannot find a file when it works locally? Vue-repo “模块构建失败:错误:未找到 ESLint 配置” - Vue-repo “Module build failed: Error: No ESLint configuration found” 为什么“npm run build”在开发服务器上花费超过 30 分钟而在本地不到一分钟? - why does 'npm run build' take >30 minutes on development server and less than a minute locally?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM