unable to load resolver "node". (import/no-duplicates)

解决:
应该是升级不完全造成的,还需要升级依赖插件npm i eslint-plugin-import@latest
源码

分析:

"eslint": "^4.1.1",
"eslint-config-standard": "^10.2.1",
"eslint-friendly-formatter": "^2.0.7",
"eslint-loader": "^1.6.1",
"eslint-plugin-html": "^2.0.3",
"eslint-plugin-import": "^2.6.1",  // 对应插件
"eslint-plugin-node": "^4.2.2",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-standard": "^3.0.1",

eslint-plugin-import 依赖 eslint-import-resolver-node升级到了0.3.1
所以手动升级它:

`npm i eslint-plugin-import@latest`

用的atom,开发使用ES6语法

ESLint 升级eslint@3.19.0后报错:unable to load resolver "node". (import/no-duplicates)

index.js

import Vue from 'vue'
import Router from 'vue-router'

main.js

import Vue from 'vue'
import { sync } from 'vuex-router-sync'
import ElementUI from 'element-ui'

第一行import报错:unable to load resolver "node". (import/no-duplicates)

阅读 8.8k
1 个回答

解决:
应该是升级不完全造成的,还需要升级依赖插件npm i eslint-plugin-import@latest
源码

突然自己好了

1 篇内容引用
推荐问题
宣传栏