简体   繁体   English

\\ node_modules \\ .bin下缺少eslint

[英]eslint missing under \node_modules\.bin

I have globaly installed eslint using npm : npm install -g eslint , then I setup a configuration file eslint --init by answering the questions as follow : 我已经使用npm 全局安装了eslintnpm install -g eslint ,然后通过回答以下问题来设置配置文件eslint --init

? How would you like to configure ESLint? Use a popular style guide
? Which style guide do you want to follow? Airbnb
? Do you use React? No
? What format do you want your config file to be in? JavaScript

I tried to run eslint on my app.js file eslint app.js It doesn't work 我试图在我的app.js文件上运行eslint eslint app.js无效

I tried to run it doing so : node_modules\\.bin\\eslint app.js but Ican't eslint file under \\node_modules.bin 我试图这样运行它: node_modules\\.bin\\eslint app.js但是我无法在\\ node_modules.bin下保留文件

  • NPM Version 5.6.0 NPM版本5.6.0
  • Node Version 8.10.0 节点版本8.10.0

Seeing the error you have just mentioned after trying: 尝试后看到刚才提到的错误:

eslint --debug app.js

You need to globally install the eslint plugin import and the eslint airbnb config plugin. 您需要全局安装eslint插件导入和eslint airbnb配置插件。

npm -g install eslint-plugin-import eslint-config-airbnb-base

You need to install said plugin because in the eslint --init configuration you have selected the Airbnb style guide. 您需要安装上述插件,因为在eslint --init配置中,您已经选择了Airbnb样式指南。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM