为何执行npm安装eslint-config-rallycoding时ESLint无法完成安装?
eslint-config-rallycoding Installation Failures in Your albums App Hey there! Let's work through this issue step by step. I see you're building your first app albums with Atom while taking a Udemy course, and you ran into problems installing eslint-config-rallycoding after setting up the linter and linter-eslint plugins. Those error messages give us clear clues on what's wrong—let's break them down and fix things up.
Understanding the Error Messages
First, let's unpack those log lines you shared:
deprecated eslint-plugin-class-property@1.1.0: please use eslint-plugin-babel and babel/semi
This tells us that theeslint-plugin-class-propertypackage you're indirectly installing is no longer maintained, and you should switch toeslint-plugin-babelinstead, using thebabel/semirule for semicolon handling.
@babel/plugin-check-constants@7.0.0-beta.38 requires a peer of @babel/core@7.0.0-beta.38 but none installed
Peer dependencies are packages that the installed package expects to exist in your project. Here,@babel/plugin-check-constantsneeds a very specific beta version of@babel/corethat isn't currently in your project.
Step-by-Step Fixes
Let's tackle these issues one by one:
Replace the deprecated package
Uninstall the outdated plugin and install its recommended replacement:npm uninstall --save-dev eslint-plugin-class-property npm install --save-dev eslint-plugin-babelAfter this, update your ESLint config (usually
.eslintrcor.eslintrc.json) to replace any references toclass-propertyrules with thebabelequivalent. For example, if you hadclass-property/semi, switch it tobabel/semi.Install the missing peer dependency
Install the exact beta version of@babel/corethat the plugin requires:npm install --save-dev @babel/core@7.0.0-beta.38Retry installing
eslint-config-rallycoding
Now that we've addressed the underlying issues, run the original install command again:npm install --save-dev eslint-config-rallycodingIf issues persist, clear your npm cache
Sometimes cached packages can cause installation hiccups. Clear the cache and try again:npm cache clean --force npm install --save-dev eslint-config-rallycoding
Quick Check After Installation
Once everything installs successfully, fire up Atom and make sure your linter is working as expected. If you still see ESLint errors, double-check your .eslintrc file to ensure it's extending rallycoding correctly:
{ "extends": "rallycoding" }
内容的提问来源于stack exchange,提问作者corky romano

