Laravel Mix unknown option ‘–hide-modules’ error

Update Laravel Mix npm install –save-dev laravel-mix@latest Update Your NPM Scripts If your build throws an error such as Unknown argument: –hide-modules, the scripts section of your package.json file will need to be updated. The Webpack 5 CLI removed a number of options that your NPM scripts was likely referencing. While you’re at it, go … Read more

Clear *just one* package from NPM cache

> npm cache ls [email protected] make-fetch-happen:request-cache:https://registry.npmjs.org/vue/-/vue-2.6.12.tgz make-fetch-happen:request-cache:https://registry.npmjs.org/vue make-fetch-happen:request-cache:https://registry.npmjs.org/vue all list item is the cache key, then clean the cache by key > npm cache clean make-fetch-happen:request-cache:https://registry.npmjs.org/vue/-/vue-2.6.12.tgz > npm cache clean make-fetch-happen:request-cache:https://registry.npmjs.org/vue > npm cache clean make-fetch-happen:request-cache:https://registry.npmjs.org/vue or use shell to batch handle npm cache ls [email protected] | xargs npm cache clean

Module parse failed: Unexpected token (257:106) You may need an appropriate loader to handle this file type

I made a workaround. I compared my old and new package-lock.json of my projects and I saw some @babel lib version changed to v7.20.2 (on Nov 4th, 2022). I overwrote the new package-lock.json with old one and my react app built and ran successfully again. I then changed (downgrade) some of @babel package in my … Read more