Have you installed the package?
npm install --global cross-env
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm attempting to install Spark in a Homestead VM on my Windows 10 machine.
When I run:
spark new projectname
everything runs fine until the compile assets part:
Would you like to compile your assets? (yes/no) [yes]:
>
Running Build Script...
> @ dev /home/vagrant/code/projectname
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
sh: 1: cross-env: not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! @ dev: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the @ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vagrant/.npm/_logs/2019-09-22T10_58_35_018Z-debug.log
vagrant@homestead:~/code$
I've tried:
npm install --no-bin-links
and
npm rebuild
but whenever I run:
npm run dev
I get the cross-env not found error.
Can anyone see what I am doing wrong?
Please or to participate in this conversation.