Programming/JavaScript & TypeScript

[Vue, eslint] vue-cli-service build 수행 시 Failed to load config "airbnb" to extend from. 에러 해결

Bonita SY 2022. 3. 3. 23:57
728x90
반응형

 에러 발생 환경 

package.json

  "devDependencies": {
    "@vue/cli-plugin-babel": "^4.5.0",
    "@vue/cli-plugin-eslint": "^4.5.0",
    "@vue/cli-service": "^4.5.14",
    "babel-eslint": "^10.1.0",
    "eslint": "^6.7.2",
    "eslint-plugin-vue": "^6.2.2",
    "node-sass": "^6.0.1",
    "prettier": "^2.5.1",
    "sass-loader": "^10.2.0",
    "vue-template-compiler": "^2.6.14"
  },

 

 

.eslintrc

{
  "extends": [
    "airbnb",
	...
  ],
  ...
}

 

vue.config.js

module.exports = {
  lintOnSave: true,
  ...
};

 

 해결 절차 

이슈 1

Syntax Error: Thread Loader (Worker 0)
Failed to load config "airbnb" to extend from.
Referenced from: C:\Users\sy\test-project\.eslintrc
    at _normalizeObjectConfigDataBody.next (<anonymous>)
    at _normalizeObjectConfigData.next (<anonymous>)

 

해결 1

npm install -g install-peerdeps
install-peerdeps --dev eslint-config-airbnb
install-peerdeps --dev eslint-config-airbnb-base

※ install-peerdeps --dev eslint-config-airbnb eslint-config-airbnb-base => 이렇게는 안됨. 에러 발생

 

출처 : https://stackoverflow.com/questions/69733256/failed-to-load-config-airbnb-to-extend-from-gitlab-ci

 

Failed to load config "airbnb" to extend from - gitlab ci

I tried to do and redo the Airbnb eslint installation in various ways, but I always get this build error inside GitLab-ci. It works in my local environment. I created the project with the create-re...

stackoverflow.com

 

위 명령어 수행 후 업데이트된 package.json

  "devDependencies": {
    "@vue/cli-plugin-babel": "^4.5.0",
    "@vue/cli-plugin-eslint": "^4.5.0",
    "@vue/cli-service": "^4.5.14",
    "babel-eslint": "^10.1.0",
    "eslint": "^8.2.0",
    "eslint-config-airbnb": "^19.0.4",
    "eslint-config-airbnb-base": "^15.0.0",
    "eslint-plugin-import": "^2.25.2",
    "eslint-plugin-jsx-a11y": "^6.5.1",
    "eslint-plugin-react": "^7.28.0",
    "eslint-plugin-react-hooks": "^4.3.0",
    "eslint-plugin-vue": "^6.2.2",
    "node-sass": "^6.0.1",
    "prettier": "^2.5.1",
    "sass-loader": "^10.2.0",
    "vue-template-compiler": "^2.6.14"
  },

 

 

vue-cli-service build 수행

 

 

이슈 2

Syntax Error: Thread Loader (Worker 0)
eslint.CLIEngine is not a constructor

 

해결 2

npm uninstall eslint
npm install eslint@5.16.0 --save-dev

 

출처 : https://tristan91.tistory.com/516

 

TypeError: this.cliEngine is not a constructor

webstorm에서 eslint 적용 후 TypeError: this.cliEngine is not a constructor 위와 같은 에러 발생 webstorm 버전을 2018.3.6 버전으로 업데이트하고, eslint 버전을 6.6에서 5.16.0으로 변경하라는 글이 있어서..

tristan91.tistory.com

 

 

vue-cli-service build 수행

 

 

 결과 

eslint 수행 후 정상적으로 빌드 완료

728x90
반응형