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

Corbin's avatar

Trying to install Foundation 6 and getting "sh: cross-env: command not found" with npm run dev

I'm following these instructions to install foundation 6 in my Laravel 5.5 project, but whenever I run npm run dev I get this error:

> @ dev /Applications/MAMP/htdocs/peachtree
> npm run development


> @ development /Applications/MAMP/htdocs/peachtree
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

sh: cross-env: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! @ development: `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 @ development 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:

I've tried these instructions a few times, have ran npm run dev without problem today, and everyone says those instructions that I used to install foundation work so I'm lost as to what's going on.

0 likes
4 replies
bobbybouwmann's avatar

cross-env is a node dependency, you can install it by running

npm install cross-env
Corbin's avatar

@bobbybouwmann I forgot to say I tried that as well, and got a different error:

> @ dev /Applications/MAMP/htdocs/peachtree
> npm run development


> @ development /Applications/MAMP/htdocs/peachtree
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: spawn node_modules/webpack/bin/webpack.js ENOENT
    at _errnoException (util.js:1024:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
    at onErrorNT (internal/child_process.js:372:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:678:11)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: `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! Exit status 1
npm ERR! 
npm ERR! Failed at the @ development 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:
bobbybouwmann's avatar

Have you tried updating your node version? It looks like it was already fixed!

ralphjesy12's avatar

I also have this error, same with @Corbin :

events.js:183
      throw er; // Unhandled 'error' event

node -v : v9.5.0 npm -v : 5.6.0

Please or to participate in this conversation.