I think the quick and dirty solution would be to delete your node_modules folder, update the laravel-mix version in package.json then run npm install
Trying to update laravel-mix package
Hello, I wanted to use mix version() to create versioning of js files, so when I activate this on web pack.mix.js I've found that the hash was created as part of filename /js/app.73108c3c3cf952f6bb6c.js so I realized that I was using an old version of laravel-mix "laravel-mix": "^0.12.1"
My question here is how to update laravel-mix package? I need to update other packages?
I have tried for example to run npm install [email protected]and the output was
npm WARN deprecated [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
> [email protected] postinstall /Users/dubideas/Documents/Web/autonomo-app/app/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js
npm WARN [email protected] requires a peer of webpack@^2.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
So I tried to compile trough npm run prod but It output errors:
> @ prod /Users/dubideas/Documents/Web/autonomo-app/app
> npm run production
> @ production /Users/dubideas/Documents/Web/autonomo-app/app
> cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
undefined:20
}]
^
SyntaxError: Unexpected token } in JSON at position 340
at JSON.parse (<anonymous>)
at babelrc (/Users/dubideas/Documents/Web/autonomo-app/app/node_modules/laravel-mix/src/config.js:191:36)
at global.tap (/Users/dubideas/Documents/Web/autonomo-app/app/node_modules/laravel-mix/src/helpers.js:10:5)
at Object.babel (/Users/dubideas/Documents/Web/autonomo-app/app/node_modules/laravel-mix/src/config.js:189:13)
at module.exports (/Users/dubideas/Documents/Web/autonomo-app/app/node_modules/laravel-mix/src/builder/webpack-rules.js:15:33)
at WebpackConfig.buildRules (/Users/dubideas/Documents/Web/autonomo-app/app/node_modules/laravel-mix/src/builder/WebpackConfig.js:79:41)
at WebpackConfig.build (/Users/dubideas/Documents/Web/autonomo-app/app/node_modules/laravel-mix/src/builder/WebpackConfig.js:25:14)
at Object.<anonymous> (/Users/dubideas/Documents/Web/autonomo-app/app/node_modules/laravel-mix/setup/webpack.config.js:26:38)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
Any ideas?
This was solved updating laravel-mix package and webpack and deleting babelrc. The error was in .babelrc file as this shows:
SyntaxError: Unexpected token } in JSON at position 340
at JSON.parse (<anonymous>)
at babelrc (/Users/dubideas/Documents/Web/autonomo-app/app/node_modules/laravel-mix/src/config.js:191:36)
Please or to participate in this conversation.