简体   繁体   English

项目依赖树的错误 Babel Eslint 问题

[英]Error Babel Eslint problem with the project dependency tree

I did try the following steps that has been advised but in vain.我确实尝试了以下建议但徒劳的步骤。 I even tried uninstalling nodejs and reinstalling and many other suggestions in StackOverflow and github.我什至尝试在 StackOverflow 和 github 中卸载 nodejs 并重新安装以及许多其他建议。 Could someone help me out here.有人可以帮我吗。

there might be a problem with the project dependency tree.it is likely not a bug in create react app, but something you need to fix locally.项目依赖树可能存在问题。它可能不是创建反应应用程序中的错误,而是您需要在本地修复的问题。

the react-scripts package provided by create react app requires a dependency:"babel-eslint": "^10.1.0" create react app 提供的 react-scripts package 需要依赖:“babel-eslint”:“^10.1.0”

don't try to install it manually: your package manager does it automatically.however,不要尝试手动安装:您的 package 管理器会自动安装。但是,

a different version of babel-eslint was detected higher up in the tree:c:\users\aksha\node_modules\babel-eslint (version: 7.2.3)manually installing incompatible versions is known to cause hard-to-debug issues.在树的较高位置检测到不同版本的 babel-eslint:c:\users\aksha\node_modules\babel-eslint(版本:7.2.3)已知手动安装不兼容的版本会导致难以调试的问题。

if you would prefer to ignore this check, add skip_preflight_check=true to an.env file in your project.that will permanently disable this message but you might encounter other issues.to fix the dependency tree, try following the steps below in the exact order:如果您希望忽略此检查,请将 skip_preflight_check=true 添加到项目中的 an.env 文件中。这将永久禁用此消息,但您可能会遇到其他问题。要修复依赖关系树,请尝试按照以下步骤操作:

  1. delete package-lock.json (not package.json.) and/or yarn.lock in your project folder.在项目文件夹中删除 package-lock.json(不是 package.json。)和/或 yarn.lock。

  2. delete node_modules in your project folder.删除项目文件夹中的 node_modules。

  3. remove "babel-eslint" from dependencies and/or devdependencies in the package.json file in your project folder.从项目文件夹中 package.json 文件中的依赖项和/或 devdependencies 中删除“babel-eslint”。

  4. run npm install or yarn, depending on the package manager you use.in most cases, this should be enough to fix the problem.if this has not helped, there are a few other things you can try:运行 npm install 或 yarn,取决于您使用的 package 管理器。在大多数情况下,这应该足以解决问题。如果这没有帮助,您可以尝试其他一些方法:

  5. if you used npm, install yarn ( http://yarnpkg.com/ ) and repeat the above steps with it instead.this may help because npm has known issues with package hoisting which may get resolved in future versions. if you used npm, install yarn ( http://yarnpkg.com/ ) and repeat the above steps with it instead.this may help because npm has known issues with package hoisting which may get resolved in future versions.

  6. check if c:\users\aksha\node_modules\babel-eslint is outside your project directory.for example, you might have accidentally installed something in your home folder.检查 c:\users\aksha\node_modules\babel-eslint 是否在您的项目目录之外。例如,您可能不小心在主文件夹中安装了一些东西。

  7. try running npm ls babel-eslint in your project folder.this will tell you which other package (apart from the expected react-scripts) installed babel-eslint.尝试在您的项目文件夹中运行 npm ls babel-eslint。这将告诉您哪些其他 package(除了预期的反应脚本)安装了 babel-eslint。

if nothing else helps, add skip_preflight_check=true to an.env file in your project.that would permanently disable this preflight check in case you want to proceed anyway.ps we know this message is long but please read the steps above:-)如果没有其他帮助,请将 skip_preflight_check=true 添加到项目中的 an.env 文件中。这将永久禁用此预检检查,以防您仍想继续。ps 我们知道此消息很长,但请阅读上述步骤:-)

we hope you find them helpful.npm err.我们希望它们对您有所帮助。npm 错误。 code elifecyclenpm err: errno 1npm err!代码 elifecyclenpm err: errno 1npm err! mevo@0.1.0 start: react-scripts start npm err. mevo@0.1.0 start: react-scripts start npm 错误。 exit status 1npm err.npm err.退出状态 1npm err.npm 错误。 failed at the mevo@0.1.0 start script:npm err: this is probably not a problem with npm.在 mevo@0.1.0 启动脚本失败:npm 错误:这可能不是 npm 的问题。 there is likely additional logging output above.npm err!上面可能还有额外的日志记录 output。npm 错误! a complete log of this run can be found in:npm err!此运行的完整日志可以在:npm err! c:\users\aksha.desktop-8t3go8b\appdata\roaming\npm-cache_logs\2021-02-03t05_26_59_598z-debug.log c:\users\aksha.desktop-8t3go8b\appdata\roaming\npm-cache_logs\2021-02-03t05_26_59_598z-debug.log

Try adding '.env' file in root directory of your project and add this to file -尝试在项目的根目录中添加“.env”文件并将其添加到文件中 -

SKIP_PREFLIGHT_CHECK=true SKIP_PREFLIGHT_CHECK=真

This might help.这可能会有所帮助。

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

相关问题 项目依赖树问题(babel-jest/reactjs) - Problem with Project Dependency Tree (babel-jest/reactjs) ReactJS npm 启动错误。 项目依赖树的问题 - ReactJS npm start error. Problem with project dependency tree 'npm start' 返回错误:“项目依赖树可能有问题” - 'npm start' returns error: "There might be a problem with the project dependency tree" Create React App 中项目依赖树的问题 - Problem with project dependency tree in Create React App 尝试在之后立即启动 React 时出错(项目依赖树可能有问题......) - Getting an error trying to start React right after (There might be a problem with the project dependency tree…) 无法使用 eslint-config-airbnb 解析依赖树 - Unable to resolve dependency tree with eslint-config-airbnb 离开 useEffect 空的依赖给 eslint 错误 - Leave useEffect empty dependency giving eslint error 将样式导入React组件时,Eslint Babel抑制错误 - Eslint babel suppress error when importing styles into react component 当我在nextjs上使用babel别名时出现Eslint错误 - Eslint error when I use babel alias on nextjs 错误:无法加载在“.eslintrc”中声明的解析器“babel-eslint”:在 create-react-app 中找不到模块“babel-eslint” - Error: Failed to load parser 'babel-eslint' declared in '.eslintrc': Cannot find module 'babel-eslint' in create-react-app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM