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

fix "Vue packages version mismatch" error caused by other global packages #5163

Merged
merged 1 commit into from Feb 27, 2020

Conversation

sodatea
Copy link
Member

@sodatea sodatea commented Feb 8, 2020

closes #5161

The root cause of such issues:

vue-jscodeshift-adapter requires vue-template-compiler.
vue-template-compiler tries to require the vue package and check
its version on startup.

Normally, there's no vue package in the dependency tree of @vue/cli,
so this check will just skip.

But if the user has installed some other global package that depend on
vue, and hoists it to the root node_modules, vue-template-compiler
would successfully require it and check against that vue version,
which sometimes may be outdated, thus failing the bootstrap process.

So by adding a "vue" dependency to the @vue/cli package, we can make sure the vue-template-compiler package in the dependency tree can always get the up-to-date version number and pass the test.

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Underlying tools
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

Other information:

… packages

closes vuejs#5161

The root cause of such issues:

`vue-jscodeshift-adapter` requires `vue-template-compiler`.
`vue-template-compiler` tries to require the `vue` package and check
its version on startup.

Normally, there's no `vue` package in the dependency tree of `@vue/cli`,
so this check will just skip.

But if the user has installed some other global package that depend on
`vue`, and hoists it to the root `node_modules`, `vue-template-compiler`
would successfully require it and check against that `vue` version,
which sometimes may be outdated, thus failing the bootstrap process.
@sodatea sodatea merged commit d8db292 into vuejs:dev Feb 27, 2020
@sodatea sodatea deleted the fix-vue-version-mismatch branch February 27, 2020 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vue packages version mismatch:
2 participants