2017-04-13 2 views
1

私はLaravelスパークv4.0.9アプリ上でnpm run devを実行すると、私は次のエラーを取得する:Laravel Spark v4.0.9で「Vueパッケージのバージョンが一致しません」というエラーを修正するにはどうすればよいですか?

Module build failed: Error: 

Vue packages version mismatch: 

- [email protected] 
- [email protected] 

This may cause things to work incorrectly. Make sure to use the same version for both. 
If you are using [email protected]>=10.0, simply update vue-template-compiler. 
If you are using [email protected]<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest. 

マイpackage.jsonは次のようになります。私は、異なる時間に(次のことを試してみました

{ 
    "private": true, 
    "scripts": { 
    "dev": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 
    "watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 
    "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", 
    "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" 
    }, 
    "dependencies": { 
    "axios": "^0.15.2", 
    "bootstrap": "^3.0.0", 
    "cross-env": "^3.2.3", 
    "jquery": "^2.1.4", 
    "js-cookie": "^2.1.0", 
    "laravel-mix": "0.*", 
    "moment": "^2.10.6", 
    "promise": "^7.1.1", 
    "sweetalert": "^1.1.3", 
    "underscore": "^1.8.3", 
    "urijs": "^1.17.0", 
    "vue": "~2.0.1", 
    "vue-resource": "^1.2.0", 
    "vue-router": "^2.2.1", 
    "vue-truncate-filter": "^1.1.6", 
    "vuejs-datepicker": "^0.6.2" 
    }, 
    "devDependencies": { 
    "browser-sync": "^2.18.8", 
    "browser-sync-webpack-plugin": "^1.1.4" 
    } 
} 

、ではない)ために:

  • node_modulesnpm install
  • を削除しました
  • がちょうどvue-loaderを削除し、他の非を削除依存関係
  • を把握するVUEとVUEのテンプレートコンパイラではなく、インストールするには、NPMにそれを残したり、糸の正確なバージョンを指定する
  • を再インストールyarnyarn upgrade
  • を実行してみました壁に頭を叩いて-essentialパッケージ(VUE-ルータ、VUE-切り捨てフィルタ、vuejs-日付ピッカー)と上記のすべてをしようと再び
+0

「糸のアップグレードvue」まで2.4.1私のためにこの問題を修正 –

答えて

1

は、これは私のために働いた:

  1. 修正package.json

    “vue”: “^2.0.8", 
    “vue-template-compiler”: “^2.1.8" 
    
  2. vueためnode_modules

  3. 実行npm install
+0

上司のように!そうです、それも私のために働いていました。ありがとう@エスペン。 –

0

チェックの依存関係を削除し、vue-template-compilerのためのdevの依存関係に正確に置き換えてください。

たとえば、

"dependencies": { 
    "vue": "^2.5.2", 
}, 
"devDependencies": { 
    "vue-template-compiler": "^2.5.3", 
}, 

を置き換えてください:

"dependencies": { 
    "vue": "2.5.2", 
}, 
"devDependencies": { 
    "vue-template-compiler": "2.5.2", 
}, 

そして再びnpm installを実行します。

0

これが私の仕事:

  1. 修正package.json: "VUE":を "VUE" "^ 2.5.2": "2.5 *"
  2. フォルダが
  3. をnode_modules削除
  4. npmインストールを実行する
0

ここでは、vueテンプレートコンパイラがvueテンプレートをコンパイルします。 vue 1バージョンとvue-template-compilerを別のバージョンで使用すると、それが問題になります。

を実行し、このコマンドは

npm update vue-template-compiler 

これは、問題を解決し、それがVUE jsのバージョン気に入りテンプレートコンパイラと同じバージョンをインストールします。

関連する問題