By default, laravel-mix uses yarn to add dependencies and there is no way to use npm instead.
However I see forceNpm option in the Dependencies.install method, but it is not used.
Can you please expose this option to laravel-mix options?
For now, the only way to use npm is to delete yarn completely
npm run dev
+1 to this, I have deleted my yarn.lock file and it still tries to use yarn to install dependencies. I keep quitting out and installing the dependency manually
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I think this issue is not stale
This is a critical issue. Why in the hell is laravel-mix installing any dependencies in the first place? That's what package.json is for. If there's a problem, just spit out an error and require the developer to fix it manually. Defaulting to an outdated, deprecated package manager like yarn is hard to comprehend.
The Laravel documentation says to install mix using npm. To have mix then install additional dependencies using yarn is confusing and seems broken.
Would be great if this was either configurable at the mix config level or by being able to specify the use of npm from the cli (--force-npm or something).
Another friendly option could be to check if yarn.lock exists and only use yarn in that case? Otherwise, default to npm?
I'd be happy to try and contribute this change if someone can give me a direction I should head.
@hackel I love how quickly Yarn went from the "hot new thing" to "outdated, deprecated package manager." Can you point to me where/when it was deprecated?
Yarn will only be used if you have it installed on your machine. If you prefer npm, remove it.
That said, with the next release, we'll drop back to using npm for everything since Yarn no longer offers any meaningful advantage (to my current knowledge). I'll do that today.
Most helpful comment
This is a critical issue. Why in the hell is laravel-mix installing any dependencies in the first place? That's what package.json is for. If there's a problem, just spit out an error and require the developer to fix it manually. Defaulting to an outdated, deprecated package manager like yarn is hard to comprehend.