Closed lloydjatkinson closed 2 years ago
Hi!
I think this is related to @vue/cli-plugin-unit-jest, not vue-jest: https://github.com/vuejs/vue-cli/issues/6445
vue-jest@3.x
is no longer supported.
Please upgrade to @vue/cli-plugin-unit-jest
that uses supported vue-jest.
npm install --save-dev @vue/cli-plugin-unit-jest@next @vue/vue2-jest jest
I feel that Vue CLI should be installing the correct versions of dependencies. Why does vue create
not install the correct and up to date versions?
vue-jest@3.x
is no longer supported. Please upgrade to@vue/cli-plugin-unit-jest
that uses supported vue-jest.npm install --save-dev @vue/cli-plugin-unit-jest@next @vue/vue2-jest jest
For Vue3 I modify the script a bit.
First step is remove all Jest related, then run below command
npm install --save-dev @vue/cli-plugin-unit-jest@next @vue/vue3-jest jest ts-jest
In my case I'm using typescript, if your project don't need that then remove ts-jest, what I changed here is @vue/vue3-jest
Hope this help!
vue-jest@3.x
is no longer supported. Please upgrade to@vue/cli-plugin-unit-jest
that uses supported vue-jest.npm install --save-dev @vue/cli-plugin-unit-jest@next @vue/vue2-jest jest
For Vue3 I modify the script a bit. First step is remove all Jest related, then run below command
npm install --save-dev @vue/cli-plugin-unit-jest@next @vue/vue3-jest jest ts-jest
In my case I'm using typescript, if your project don't need that then remove ts-jest, what I changed here is @vue/vue3-jest
Hope this help!
Thank you very much. You saved my day!!
I feel that Vue CLI should be installing the correct versions of dependencies. Why does vue create not install the correct and up to date versions?
Out of nowhere, since trying out Node 16 and Node 17,
npm install
fails because ofdeasync
.I can see that
deasync
is a dependency ofvue-jest
:The reason for this issue is that for whatever reason the
deasync
library has dependencies on some nasty Python and Node GYP stuff. Why this is only a problem now with Node 16 and Node 17 I don't know, but it's starting to cause a big problem for Vue CLI users upgrading to the current version of Node. We are stuck on Node 14 LTS.Given the LTS will eventually be deprecated, every user of Vue CLI/vue-jest is going to encounter this problem soon.
I am sure I'm not alone in thinking it's pretty ridiculous needing Python installed purely for the sake of that poorly maintained library. Especially if a developer has no other need of Python.
(As for why
npm install
needs to run a C++ compiler via Python, rather than just having the binary on npm, that's a whole other topic...)