question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Outdated webpack.mix.js and package.json after fresh installation of Laravel 5.4.32 with Laravel Mix 1.0

See original GitHub issue
  • Laravel Mix Version: #.#.# (npm list --depth=0) that command doesn’t return anything after the fresh install of Laravel
  • Node Version (node -v): 6.11.2
  • NPM Version (npm -v): 4.2.0
  • OS: Ubuntu 16.04 / Homestead on Windows10

Description:

I receive the following outdated content in both webpack.mix.js and package.json when I make a fresh install (inside Homestead’s Ubuntu) with the command below. According to the instructions here the content should be very different: https://github.com/JeffreyWay/laravel-mix/blob/master/docs/installation.md

Steps To Reproduce:

Following the instructions here: https://laravel.com/docs/5.4 I just executed this command.

laravel new blog

webpack.mix.js

let mix = require('laravel-mix');

/*
 |--------------------------------------------------------------------------
 | Mix Asset Management
 |--------------------------------------------------------------------------
 |
 | Mix provides a clean, fluent API for defining some Webpack build steps
 | for your Laravel application. By default, we are compiling the Sass
 | file for the application as well as bundling up all the JS files.
 |
 */

mix.js('resources/assets/js/app.js', 'public/js')
   .sass('resources/assets/sass/app.scss', 'public/css');

package.json

{
  "private": true,
  "scripts": {
    "dev": "npm run development",
    "development": "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",
    "watch-poll": "npm run watch -- --watch-poll",
    "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",
    "prod": "npm run production",
    "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
  },
  "devDependencies": {
    "axios": "^0.16.2",
    "bootstrap-sass": "^3.3.7",
    "cross-env": "^5.0.1",
    "jquery": "^3.1.1",
    "laravel-mix": "^1.0",
    "lodash": "^4.17.4",
    "vue": "^2.1.10"
  }
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:22 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
JeffreyWaycommented, Aug 4, 2017

@patlecat You seem to be experiencing issues related to faulty installs. Every error you’ve posted is related to something missing. It’s tough to debug these sorts of things, because Mix specifically lists them as dependencies. So there’s no code-related change I can make here.

Try to do a full reset:

rm -rf node_modules
rm package-lock.json yarn.lock
npm cache clear --force
npm install
2reactions
JeffreyWaycommented, Aug 8, 2017

You don’t need to look at Mix’s webpack.config.js file. It’s a relative path to the src folder, which does exist.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Outdated webpack.mix.js and package.json after fresh ...
Outdated webpack.mix.js and package.json after fresh installation of Laravel 5.4.32 with Laravel Mix 1.0 #1095.
Read more >
Installation | Laravel Mix Documentation
Install Laravel ; Run npm install; Visit your webpack.mix.js file, and get started! ... and then update your package.json NPM scripts accordingly: cp ......
Read more >
Laravel Mix "sh: 1: cross-env: not found error" - Stack Overflow
The error I am getting when I run any npm run command. > Code@1.0.0 dev /home/vagrant/Code > cross-env NODE_ENV=development webpack --progress ...
Read more >
Compiling Assets (Mix) - The PHP Framework For Web Artisans
The only remaining step is to install Laravel Mix. Within a fresh installation of Laravel, you'll find a package.json file in the root...
Read more >
How can I install laravel-mix in laravel 5.3 - Laracasts
I didn't have to change anything in the webpack.config.js file but I did update the webpack.mix.js config. By default its set to look...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found