gtm-support / vue-gtm

Simple implementation of Google Tag Manager for Vue
https://www.npmjs.com/package/@gtm-support/vue-gtm
MIT License
198 stars 23 forks source link

Bug: cannot install with vue@^3.2.0 #351

Closed jonalexander closed 12 months ago

jonalexander commented 1 year ago

Info

Tool Version
Plugin v2.0.0
Vue v3.2.0
Node v18
OS mac

Input

npm install

Output or Error

npm ERR! Could not resolve dependency:
npm ERR! @gtm-support/vue-gtm@"^2.0.0" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: vue@3.2.47
npm ERR! node_modules/vue
npm ERR!   peer vue@"^3.2.0" from @gtm-support/vue-gtm@2.0.0
npm ERR!   node_modules/@gtm-support/vue-gtm
npm ERR!     @gtm-support/vue-gtm@"^2.0.0" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /home/node/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/node/.npm/_logs/2023-03-03T21_14_33_526Z-debug-0.log

Expected Output

Additional Context

I am migrating a Vue2 repo to Vue3 and I currently have my vue package version set to ^3.2.0 and @gtm-support/vue-gtm set to ^2.0.0.

When I run npm install I receive the error seen above. In the package.json if your repo you list a devDep for vue at ^3.2.40 and a peerDep at ^3.2.0. I have to set my vue version to ^3.2.40 to avoid the error.

kim-dokyung commented 12 months ago

any updates? I'm migrating nuxt2 to nuxt3 and found the similar issue(vue version 3.3.4)

npm ERR! Found: 
npm ERR! node_modules/vue
npm ERR!   peer vue@"^3.2.0" from @gtm-support/vue-gtm@2.0.0
npm ERR!   node_modules/@gtm-support/vue-gtm
npm ERR!     @gtm-support/vue-gtm@"^2.0.0" from the root project
Shinigami92 commented 12 months ago

I assume I need to set https://github.com/gtm-support/vue-gtm/blob/18fd3374ac4a970c12aaa1cae97ae43b82a0fd6f/package.json#L90 to >= instead of ^

Will do when I find the time

Shinigami92 commented 12 months ago

Please test v2.1.0 and report if everything is working

kim-dokyung commented 12 months ago

@Shinigami92 I tested it, and it works! thanks:) I'm in the middle of the migration to Nuxt3, so I will report if any additional issues occur