0

I am in the process of upgrading to vue@2.7 from vue@2.6 so that I can prepare to migrate entirely to vue@3 in the future.

The project currently has @vue/composition-api installed which is not compatibable with vue@2.7 so I am trying to remove this package. However no matter how many times I run npm uninstall or npm remove the package will not be removed from my package-lock.json file.

I think this is because of another package I have installed, vue-demi, which has @vue/composition-api has a peer depency. But I haven't been able to uninstall this package either and neither of these packages even exist in my package.json.

I am not sure how I can fix this but it's been driving me crazy and help would be greatly appreciated thanks!

tomthedude
  • 41
  • 7
  • See https://stackoverflow.com/questions/25997519/how-to-view-the-dependency-tree-of-a-given-npm-module . You can just remove the dep manually from package.json and remove lock file in such cases if version restrictions are not too lose and it doesn't break anything (it can, lock update is a stress for the project) – Estus Flask Mar 08 '23 at 11:40
  • I have done as you suggest and although it allowed me to run npm install succesfully, now the project fails to compile and won't run because `vue-demi` cannot find `@vue/composition-api`. I don't understand why `vue-demi` complains though since the composition-api is said to be an optional depency? – tomthedude Mar 08 '23 at 14:02
  • Please, provide https://stackoverflow.com/help/mcve that can reproduce the problem. I'd expect that it can be narrowed down to vue itself and demi. Possibly demi is not up to date, or else. "why vue-demi complains" - how exactly? The error matters. The problem is not common and it's unlikely that it can be solved with vague descriptions – Estus Flask Mar 08 '23 at 15:28
  • I willl post a thorough update of my exact error and the solution soon. I have managed to solve most of the problems that came up and in general it boils down to the lack of support for depreciated packages which didn't roll out support for vue 2.7 and its inclusion of composition-api natively. – tomthedude Mar 08 '23 at 20:10

2 Answers2

0

In my opinion this is not a problem that @vue/composition-api plugin is still in your package-lock.json file, vue-demi package needs this so it is installed as a dependency of this package.

What you need to do is remove @vue/composition-api from your dependencies from your package.json file (and you did this as far as I understand), and change the imports accordingly.

For example, from this:

import { ref } from '@vue/composition-api';

to this:

import { ref } from 'vue';
qiqqq
  • 631
  • 5
  • 10
  • I have done what you suggested, and removed the imports accordingly. But the issue still persists. If it helps I have edited my original questino to show the error I now get when running `npm install` – tomthedude Mar 08 '23 at 13:19
0

You might need to uninstall it along with vue-composable if you have it installed

Too Colline
  • 90
  • 1
  • 11