ESLint couldn‘t find the plugin “eslint-plugin-vue“

在公司另一个项目开发完成需要提交代码时,在提交前会通过eslint进行格式校验,但是会一直报错说这个插件没有找到

ESLint couldn't find the plugin "eslint-plugin-vue".

(The package "eslint-plugin-vue" was not found when loaded as a Node module from the directory "E:\desktop".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
	
The plugin "eslint-plugin-vue" was referenced from the config file in "..\package.json".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.

 报错说在我的桌面没有找到这个插件,而且我自己在desktop目录下也没有找到,但是问题就出在这里,我的项目放在desktop目录下,它通过了绝对路径去寻找这个文件,而且少了项目名,我的这个文件应该是在  E:\desktop\项目名  下,

修改项目中.eslintrc.js的配置

module.exports = {
  root: true
}

指示当前配置文件是项目的根配置,这样ESLint 会以此文件所在目录作为项目的根目录,不再从上级目录查找配置文件。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值