Nuxt.js: packages version mismatch: [email protected] & [email protected] After Upgrade to Nuxt 2.5.1

Created on 21 Mar 2019  路  9Comments  路  Source: nuxt/nuxt.js

Version

v2.5.1

Reproduction link

http://www.notrequired.com

Steps to reproduce

Hello,
Upgrading from 2.4.5 to 2.5.1 is producing FATAL errors after running npm run dev:

08:59:22 FATAL

Vue packages version mismatch:

This may cause things to work incorrectly. Make sure to use the same version for both.

Vue packages version mismatch:

  • [email protected]
  • [email protected]

    This may cause things to work incorrectly. Make sure to use the same version for both.

    at Object. (node_modules/vue-server-renderer/index.js:8:9)
    at Module._compile (internal/modules/cjs/loader.js:799:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10)
    at Module.load (internal/modules/cjs/loader.js:666:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:606:12)
    at Function.Module._load (internal/modules/cjs/loader.js:598:3)
    at Module.require (internal/modules/cjs/loader.js:705:19)
    at require (internal/modules/cjs/helpers.js:14:16)
    at Object. (node_modules/@nuxt/vue-renderer/dist/vue-renderer.js:21:27)
    at Module._compile (internal/modules/cjs/loader.js:799:30)

What is expected ?

Compiled Successfully

What is actually happening?

Getting an error

This bug report is available on Nuxt community (#c8887)
bug-report

Most helpful comment

Hi. Please try cleaning up yarn.lock/package-lock.json and do a fresh install.

All 9 comments

Hi. Please try cleaning up yarn.lock/package-lock.json and do a fresh install.

I would prefer not to have to delete my lock file. That defeats its purpose. Is there another way?

@blocka Otherwise you can list all vue/vue-server-renderer and vue-template-compiler dependencies to the devDependencies.

BTW the proposed change of https://github.com/nuxt/nuxt.js/issues/6336#issuecomment-526926413 should address this issue as well. Always picking up nuxt preferred deps.

Until now I haven't specified any version of vue...nuxt was installing vue as well. Which means it's installing vue-server-renderer. So shouldn't it use the same version?

@blocka the problem happens when another dependency in your project also depends on a different version of vue (and usually only vue not other peer deps). In this state, yarn will try to hoist a version of vue to the top node_modules which has minimum possibility of breaking change -- without being aware of the constraint that versions between this 3 packages should be equal. Recreating lock-file resolves this.

I'm having the same problem, though my versions are [email protected] and [email protected]. I'm not planning on doing any server-side rendering, so I would appreciate it if I can take vue-server-renderer out of the process.

Here are my dependencies:

    "devDependencies": {
        "@babel/plugin-syntax-dynamic-import": "^7.8.3",
        "@kazupon/vue-i18n-loader": "^0.4.1",
        "@nuxtjs/eslint-config": "^2.0.0",
        "@nuxtjs/eslint-module": "^1.0.0",
        "babel-core": "^6.26.3",
        "babel-eslint": "^10.1.0",
        "babel-plugin-dynamic-import-node": "^2.3.0",
        "babel-plugin-syntax-jsx": "^6.18.0",
        "babel-plugin-transform-vue-jsx": "^3.7.0",
        "browser-sync-webpack-plugin": "^2.0.1",
        "browser-sync": "^2.26.7",
        "clean-webpack-plugin": "^3.0.0",
        "cross-env": "^5.2.1",
        "eslint-loader": "^2.2.1",
        "eslint-plugin-nuxt": ">=0.4.2",
        "eslint-plugin-vue": "^5.2.3",
        "eslint": "^6.1.0",
        "nodemon": "^1.18.9",
        "resolve-url-loader": "^2.3.1",
        "sass-loader": "^7.1.0",
        "sass": "^1.26.3",
        "vue-template-compiler": "2.6.10"
    },
    "dependencies": {
        "@fortawesome/fontawesome-svg-core": "^1.2.27",
        "@fortawesome/free-solid-svg-icons": "^5.12.1",
        "@fortawesome/vue-fontawesome": "^0.1.9",
        "@netshapers/resources": "file:../Gears/resources",
        "@nuxtjs/pwa": "^3.0.0-0",
        "@popperjs/core": "^2.1.1",
        "@websanova/vue-auth": "^2.21.14-beta",
        "axios": "^0.19.2",
        "babel-helper-vue-jsx-merge-props": "^2.0.3",
        "bootstrap-vue": "^2.7",
        "bootstrap": "^4.4.1",
        "camelcase": "^5.3.1",
        "clipboard": "^2.0.6",
        "clone-deep": "^4.0.1",
        "core-js": "^3.6.4",
        "cross-env": "^5.2.0",
        "deepmerge": "^4.2.2",
        "del": "^5.1.0",
        "driver.js": "^0.9.8",
        "dropzone": "^5.7.0",
        "echarts": "^4.7.0",
        "es6-promise": "^4.2.8",
        "express": "^4.16.4",
        "file-saver": "^2.0.1",
        "fuse.js": "^3.6.1",
        "js-cookie": "^2.2.1",
        "jsonlint": "^1.6.3",
        "jszip": "^3.2.2",
        "laravel-mix-alias": "^1.0.2",
        "laravel-mix-bundle-analyzer": "^1.0.5",
        "laravel-mix-eslint": "^0.1.3",
        "laravel-mix": "^4.1.4",
        "less-loader": "^5.0.0",
        "less": "^3.11.1",
        "mime-types": "^2.1.26",
        "moment": "^2.24.0",
        "node-sass": "^4.13.1",
        "normalize.css": "^8.0.1",
        "nprogress": "^0.2.0",
        "numeral": "^2.0.6",
        "nuxt-i18n": "^6.11.0",
        "nuxt": "^2.12",
        "overlayscrollbars-vue": "^0.2.1",
        "overlayscrollbars": "^1.11.0",
        "path-to-regexp": "^3.2.0",
        "portal-vue": "^2.1.7",
        "query-string": "^6.11.1",
        "ramda": "^0.27.0",
        "raw-loader": "^4.0.0",
        "resize-observer-polyfill": "^1.5.1",
        "screenfull": "^4.2.1",
        "snake-case": "^3.0.3",
        "sortablejs": "^1.10.2",
        "trim": "0.0.1",
        "tui-editor": "^1.4.10",
        "vue-axios": "^2.1.5",
        "vue-clipboard2": "^0.3.1",
        "vue-count-to": "^1.0.13",
        "vue-i18n": "^8.15.5",
        "vue-multiselect": "^2.1.6",
        "vue-router": "^3.1.6",
        "vue-splitpane": "^1.0.6",
        "vue": "2.6.10",
        "vuedraggable": "^2.23.2",
        "vuelidate": "^0.7.5",
        "vuex-router": "^1.1.5",
        "vuex": "3.1.0",
        "xlsx": "^0.14.5"
    },

I resolved the problem by removing vue and other vue* dependencies that are installed by Nuxt.

This steps helped me:
rm package-lock.json
rm -rf node_modules
npm update
npm install

This steps helped me:
rm package-lock.json
rm -rf node_modules
npm update
npm install

this help me too, thx

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pehbehbeh picture pehbehbeh  路  3Comments

shyamchandranmec picture shyamchandranmec  路  3Comments

o-alexandrov picture o-alexandrov  路  3Comments

bimohxh picture bimohxh  路  3Comments

nassimbenkirane picture nassimbenkirane  路  3Comments