简体   繁体   中英

Vue-repo “Module build failed: Error: No ESLint configuration found”

My Vue project is running fine locally, but when upload it to github repo, download it back from there and npm install , then npm run dev , it throws error Module build failed: Error: No ESLint configuration found.

When I unzip my downloaded repo-files, there's no .eslintrc etc. files that are present when I'm uploading my project, and to my knowledge that is one reason causing this ESLint problem.

Here's the very basic vue init webpack HelloWorld.vue uploaded to my test-repo without any modifications to show how it fails to build after downloading.

Link to my test repo to reproduce the error: https://github.com/tuuchen/vue-movie-app

How can I fix this issue with eslint?

EDIT: I made a fresh project without eslint, and when downloading it from my git repo, It's throwing Failed to compile error, asset optimization[copy-webpack-plugin] WARNING - unable to locate '<path>\myvueapp\static'

EDIT 2: Also .postcssrc is missing when initiating npm install

EDIT 3: Problem solved . I was using webpack for creating my vue project, and it caused all kinds of issues when downloading the project back from git repo. npm install -g @vue/cli did a project that worked without issues.

Sorry for being such a noob.

This issue came up as I created a new project by copying from another project on my Mac. However, the hidden files were not copied!

Solution The issue got resolved by having these hidden files as well in the new project:

  • .babelrc,
  • .editorconfig
  • .eslintignore
  • .eslintrc.js
  • .postcssrc.js

There are other solutions that many have proposed in this Vue Issue that you can refer to if this does not solve your problem.

In my case, I just delete the folder Node.Js and try reinstall node modules using yarn/npm.

if it still did not work, you can try to add file.eslintignore on the root folder and add there the path to the folder we want to omit.

For example, in this scenario, .build/test.js is the desired file to allowlist. Because all dot-folders and their children are ignored by default, .build must first be allowlisted so that eslint becomes aware of its children. Then, .build/test.js must be explicitly allowlisted, while the rest of the content is denylisted. This is done with the following.eslintignore file:

# Allowlist 'test.js' in the '.build' folder
# But do not allow anything else in the '.build' folder to be linted
!.build
.build/*
!.build/test.js

more documentation https://eslint.org/docs/user-guide/configuring/ignoring-code#the-eslintignore-file

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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