Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

wmjaynes's avatar

Laravel Mix installation problem

I'm using Homestead on a Windows 10 machine and had some problems when I started to try to use laravel-mix in a laravel project, so I decided to follow the installation instructions for a stand-alone project to see what happens. From the installation.md file:

mkdir testmix && cd testmix
npm init -y
npm install laravel-mix --save-dev
cp -r node_modules/laravel-mix/setup/webpack.mix.js ./

However, when I execute those commands, although a lot of stuff is installed under node_modules, there is no laravel-mix under the node_modules directory and the node_modules/.bin directory is empty. Here's what I see:

vagrant@homestead:~/code/testmix$ sudo npm install laravel-mix --save-dev
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! path ../acorn/bin/acorn
npm ERR! code EPROTO
npm ERR! errno -71
npm ERR! syscall symlink
npm ERR! EPROTO: protocol error, symlink '../acorn/bin/acorn' -> '/home/vagrant/code/testmix/node_modules/.bin/acorn'

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vagrant/.npm/_logs/2017-12-20T15_41_36_456Z-debug.log
vagrant@homestead:~/code/testmix$ cp -r node_modules/laravel-mix/setup/webpack.mix.js ./
cp: cannot stat 'node_modules/laravel-mix/setup/webpack.mix.js': No such file or directory
vagrant@homestead:~/code/testmix$

I don't know what is going on here.

0 likes
6 replies
wmjaynes's avatar

I am running this in the homestead box. So the symlinks shouldn't be a problem. However, I ran npm install laravel-mix --no-bin-links and node_modules now has all the necessary stuff, including laravel-mix. So, maybe something about the homestead box on Windows 10 requires the --no-bin-links switch.

wmjaynes's avatar

I guess it makes sense, considering that a part of the file systems are being kept in sync between the homestead box and the Windows machine.

Please or to participate in this conversation.