Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing error: Cannot find module 'babel-eslint' #4708

Closed
ErickPetru opened this issue Oct 17, 2019 · 2 comments
Closed

Parsing error: Cannot find module 'babel-eslint' #4708

ErickPetru opened this issue Oct 17, 2019 · 2 comments
Labels
needs reproduction This issue is missing a minimal runnable reproduction, provided by the author

Comments

@ErickPetru
Copy link

Version

4.0.3

Environment info

  System:
    OS: Windows 10
    CPU: (4) x64 Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz
  Binaries:
    Node: 12.9.1 - C:\Program Files\nodejs\node.EXE
    npm: 6.10.2 - C:\Program Files\nodejs\npm.CMD
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0
    @vue/babel-plugin-transform-vue-jsx:  1.0.0
    @vue/babel-preset-app:  4.0.3
    @vue/babel-preset-jsx:  1.1.1
    @vue/babel-sugar-functional-vue:  1.0.0
    @vue/babel-sugar-inject-h:  1.0.0
    @vue/babel-sugar-v-model:  1.1.1
    @vue/babel-sugar-v-on:  1.1.0
    @vue/cli-overlay:  4.0.3
    @vue/cli-plugin-babel: ^4.0.3 => 4.0.3
    @vue/cli-plugin-eslint: ^4.0.3 => 4.0.3
    @vue/cli-plugin-router:  4.0.3
    @vue/cli-plugin-vuex:  4.0.3
    @vue/cli-service: ^4.0.3 => 4.0.3
    @vue/cli-shared-utils:  4.0.3
    @vue/component-compiler-utils:  3.0.0
    @vue/eslint-config-prettier: ^5.0.0 => 5.0.0
    @vue/preload-webpack-plugin:  1.1.1
    @vue/web-component-wrapper:  1.2.0
    eslint-plugin-vue: ^5.2.3 => 5.2.3
    vue: ^2.6.10 => 2.6.10
    vue-clickaway: 2.2.2 => 2.2.2
    vue-eslint-parser:  undefined (5.0.0)
    vue-hot-reload-api:  2.3.4
    vue-loader:  15.7.1
    vue-ls: ^3.2.1 => 3.2.1
    vue-material: ^1.0.0-beta-11 => 1.0.0-beta-11
    vue-router: ^3.1.3 => 3.1.3
    vue-rx: ^6.2.0 => 6.2.0
    vue-simple-spinner: ^1.2.8 => 1.2.8
    vue-style-loader:  4.1.2
    vue-template-compiler: 2.6.10 => 2.6.10
    vue-template-es2015-compiler:  1.9.1
    vue-the-mask: ^0.11.1 => 0.11.1
    vue2-transitions: 0.3.0 => 0.3.0
  npmGlobalPackages:
    @vue/cli: 4.0.3

Steps to reproduce

I was working on a project created with @vue/cli@3.11.0 with @vue/cli-plugin-babel and @vue/cli-plugin-eslint also at 3.11.0. Then I followed the migration with vue upgrade and everything was updated without errors, until I try to run the project with npm run serve.

What is expected?

Project running without errors.

What is actually happening?

A lot of repeated errors for each .vue file, like that:

error  in ./src/pages/User/Read.vue

Module Error (from ./node_modules/eslint-loader/index.js):
error: Parsing error: Cannot find module 'babel-eslint'

Require stack:
- D:\sample-project\node_modules\eslint-plugin-vue\node_modules\vue-eslint-parser\index.js       
- D:\sample-project\node_modules\eslint-plugin-vue\lib\utils\index.js
- D:\sample-project\node_modules\eslint-plugin-vue\lib\rules\array-bracket-spacing.js
- D:\sample-project\node_modules\eslint-plugin-vue\lib\index.js
- D:\sample-project\node_modules\eslint\node_modules\import-fresh\index.js
- D:\sample-project\node_modules\eslint\lib\config\config-file.js
- D:\sample-project\node_modules\eslint\lib\config.js
- D:\sample-project\node_modules\eslint\lib\cli-engine.js
- D:\sample-project\node_modules\eslint\lib\api.js
- D:\sample-project\node_modules\eslint-loader\index.js
- D:\sample-project\node_modules\loader-runner\lib\loadLoader.js
- D:\sample-project\node_modules\loader-runner\lib\LoaderRunner.js
- D:\sample-project\node_modules\webpack\lib\NormalModule.js
- D:\sample-project\node_modules\webpack\lib\NormalModuleFactory.js
- D:\sample-project\node_modules\webpack\lib\Compiler.js
- D:\sample-project\node_modules\webpack\lib\webpack.js
- D:\sample-project\node_modules\@vue\cli-service\lib\commands\serve.js
- D:\sample-project\node_modules\@vue\cli-service\lib\Service.js
- D:\sample-project\node_modules\@vue\cli-service\bin\vue-cli-service.js

The error persists with or without babel-eslint in package.json as a dev dependency.

@haoqunjiang
Copy link
Member

Can reproduce on my machine.
Could you please provide a runnable production for us to further investigate?

@haoqunjiang haoqunjiang added the needs reproduction This issue is missing a minimal runnable reproduction, provided by the author label Oct 18, 2019
@ErickPetru
Copy link
Author

Since the project is private, I couldn't publish it here to investigation.

But while trying to create a repo reproducing the problem - firstly with 3.11.0 and then upgrading to 4.0.4 - I was able to look at how dependencies were used on a clean project.

Then I started removing dependencies of the problematic project until it worked and carefully started adding back the dependencies, one by one. And now it's running, even with every dependency it had before! I really would like to point out what the problem was, but unfortunately I couldn't.

So, maybe it was only some trash in node_modules that was cleaned during dependencies uninstalls and reinstalls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs reproduction This issue is missing a minimal runnable reproduction, provided by the author
Projects
None yet
Development

No branches or pull requests

2 participants