New vue-cli application fails to compile due to eslint-loader
See original GitHub issueVersion
3.9.0
Environment info
Environment Info:
System:
OS: macOS Sierra 10.12.6
CPU: (4) x64 Intel(R) Core(TM) i5-6287U CPU @ 3.10GHz
Binaries:
Node: 10.15.3 - ~/.nvm/versions/node/v10.15.3/bin/node
Yarn: 1.13.0 - /usr/local/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v10.15.3/bin/npm
Browsers:
Chrome: 75.0.3770.100
Firefox: 67.0.4
Safari: 12.1.1
npmPackages:
@vue/babel-helper-vue-jsx-merge-props: 1.0.0
@vue/babel-plugin-transform-vue-jsx: 1.0.0
@vue/babel-preset-app: 3.9.0
@vue/babel-preset-jsx: 1.0.0
@vue/babel-sugar-functional-vue: 1.0.0
@vue/babel-sugar-inject-h: 1.0.0
@vue/babel-sugar-v-model: 1.0.0
@vue/babel-sugar-v-on: 1.0.0
@vue/cli-overlay: 3.9.0
@vue/cli-plugin-babel: ^3.9.0 => 3.9.0
@vue/cli-plugin-eslint: ^3.9.0 => 3.9.0
@vue/cli-service: ^3.9.0 => 3.9.0
@vue/cli-shared-utils: 3.9.0
@vue/component-compiler-utils: 2.6.0
@vue/preload-webpack-plugin: 1.1.0
@vue/web-component-wrapper: 1.2.0
eslint-plugin-vue: ^5.0.0 => 5.2.3 (4.7.1)
vue: ^2.6.10 => 2.6.10
vue-eslint-parser: 2.0.3 (5.0.0)
vue-hot-reload-api: 2.3.3
vue-loader: 15.7.0
vue-router: ^3.0.3 => 3.0.7
vue-style-loader: 4.1.2
vue-template-compiler: ^2.6.10 => 2.6.10
vue-template-es2015-compiler: 1.9.1
vuex: ^3.0.1 => 3.1.1
npmGlobalPackages:
@vue/cli: 3.9.0
Steps to reproduce
>vue create new-app
>cd new-app
>npm run serve
What is expected?
INFO Starting development server...
98% after emitting CopyPlugin .
DONE Compiled successfully in 3435ms 10:02:58 AM
App running at:
- Local: http://localhost:8080/
- Network: http://10.145.82.231:8080/
Note that the development build is not optimized.
To create a production build, run npm run build.
What is actually happening?
INFO Starting development server...
98% after emitting CopyPlugin
ERROR Failed to compile with 1 errors 9:53:57 AM
Module build failed (from ./node_modules/eslint-loader/index.js):
Error: Cannot find module '.../node_modules/eslint/lib/api.js/package.json'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.module.exports (.../node_modules/eslint-loader/index.js:170:23)
You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.
This is from a clean instantiation of a vue-cli application. No additional configuration to webpack or eslint. It had been working previously, so I’m thinking it could be a issue caused by a minor update to a dependency. Somewhere eslint-loader is getting a user defined eslint package path that does not exist.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:78
- Comments:43 (7 by maintainers)
Top Results From Across the Web
Why does 'vue-cli-service build' fail after creating a new eslint ...
ERROR Failed to compile with 1 error 20:47:55 Syntax Error: Thread Loader (Worker 0) eslint.CLIEngine is not a constructor You may use ...
Read more >vue/cli-plugin-eslint
This will force eslint-loader to always emit errors. this also means lint errors will now cause the compilation to fail.
Read more >eslint/eslint - Gitter
Thanks ! For some reason I have node_modules in my test folder. clean now ... but my vue-cli-service build fails after creating a...
Read more >Vue JavaScript Tutorial in Visual Studio Code
You will be prompted to select a preset and you can keep the default (babel, eslint) , which will use Babel to transpile...
Read more >Why does 'vue-cli-service build' fail after creating a new eslint ...
$ vue-cli-service build ⠧ Building for production... ERROR Failed to compile with 1 error 20:47:55 Syntax Error: Thread Loader (Worker 0) eslint.CLIEngine is ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As @ikitozen mentioned
"resolutions": { "eslint-loader": "2.1.2" }
in package.json seems to do the trick.
For npm users it should just be
npm i eslint-loader@2.1.2
right?