Laravel-mix: Laravel Mix 4 installs vue-template-compiler package even if it is redundant

Created on 26 Dec 2018  路  7Comments  路  Source: JeffreyWay/laravel-mix

  • Laravel Mix Version: 4.0.12
  • Node Version: 8.11.1
  • NPM Version: 6.4.1
  • OS: Microsoft Windows 10

Description:

I have started new Laravel project using latest version (5.7.19) and it is shipped with Laravel Mix 4.0.7. In this project I don't need any frontend scaffolding so I removed Vue scaffolding. After that when I ran npm install and then npm run watch I am getting this in the console:

Additional dependencies must be installed. This will only take a moment.

Running: yarn add vue-template-compiler --dev --production=false
warning " > [email protected]" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0".

Okay, done. The following packages have been installed and saved to your package.json dependencies list:

  • vue-template-compiler

Why Laravel Mix 4 install this additional and obviously redundant package vue-template-compiler on the fly when I have removed Vue from scaffolding and how to get a rid of that package?

After all, I have tried to use Laravel Mix 4.0.7 and 4.0.12 - same thing in both cases.

Steps To Reproduce:

  1. Install new fresh copy of Laravel
  2. Run php artisan preset none
  3. Run npm install
  4. Run npm run watch

Most helpful comment

Hey, @JeffreyWay you mentioned that this dependency needs to stay until the next major release.
I am on v5 right at the moment and still getting it. Any chance removing it anytime soon?

All 7 comments

I have a similar problem without setting preset to none, but using default one shipped for Laravel.

I was able to run my npm run ... after
npm install vue-template-compiler

My project is using react and yet it still installs this package.

Mix has always installed this package. The only difference is it's now being pulled in locally.

Mix was originally built with Vue in mind, so until the next major release, this dependency needs to stay. Just ignore it.

I do not want to have vue-template-compiler dependency in my package.json file. Can it not be forced to install?

Hey, @JeffreyWay you mentioned that this dependency needs to stay until the next major release.
I am on v5 right at the moment and still getting it. Any chance removing it anytime soon?

If you need a quick-fix before my PR is merged, I also gived a hack to remove the dependency by hand. https://github.com/JeffreyWay/laravel-mix/issues/1877#issuecomment-596111404

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kpilard picture kpilard  路  3Comments

pixieaka picture pixieaka  路  3Comments

wendt88 picture wendt88  路  3Comments

mementoneli picture mementoneli  路  3Comments

stefensuhat picture stefensuhat  路  3Comments