Filip_Zdravkovic's avatar

MIX: 'cross-env' is not recognized as an internal or external command, operable program or batch file.

Did you get the following error when trying to run Mix tasks?

npm run dev

> @ dev C:\xampp\htdocs\test\test
> cross-env NODE_ENV=development node_mo
dules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

'cross-env' is not recognized as an internal or external command,
operable program or batch file.

...

npm ERR! node v7.5.0
npm ERR! npm  v4.1.2
npm ERR! code ELIFECYCLE
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! Exit status 1
npm ERR!
npm ERR! Failed at the @ dev script 'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup                 /webpack.config.js'.

I'm using Laravel 5.4.16 (WINDOWS).

0 likes
3 replies
byawitz's avatar

have you run npm install in the root of your project? if not run it

> @ dev C:\xampp\htdocs\test\npm  install

after its done run

> @ dev C:\xampp\htdocs\test\npm run dev
3 likes
Djusko's avatar

Is there someone still having this problem? as I am I am using the latest version of node - 8.1.3.

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'development' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'predevelopment', 'development', 'postdevelopment' ]
5 info lifecycle @~predevelopment: @
6 silly lifecycle @~predevelopment: no script for predevelopment, continuing
7 info lifecycle @~development: @
8 verbose lifecycle @~development: unsafe-perm in lifecycle true
9 verbose lifecycle @~development: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;C:\wamp\www\laravel-blog\node_modules\.bin;C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;C:\wamp\www\laravel-blog\node_modules\.bin;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Skype\Phone\;;C:\wamp\bin\php\php5.6.25;C:\ProgramData\ComposerSetup\bin;C:\Program Files\nodejs\;C:\Users\Djusa\AppData\Roaming\Composer\vendor\bin;C:\Users\Djusa\AppData\Roaming\npm
10 verbose lifecycle @~development: CWD: C:\wamp\www\laravel-blog
11 silly lifecycle @~development: Args: [ '/d /s /c',
11 silly lifecycle   'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js' ]
12 silly lifecycle @~development: Returned: code: 1  signal: null
13 info lifecycle @~development: Failed to exec development script
14 verbose stack Error: @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:283:16)
14 verbose stack     at emitTwo (events.js:125:13)
14 verbose stack     at EventEmitter.emit (events.js:213:7)
14 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:125:13)
14 verbose stack     at ChildProcess.emit (events.js:213:7)
14 verbose stack     at maybeClose (internal/child_process.js:897:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:208:5)
15 verbose pkgid @
16 verbose cwd C:\wamp\www\laravel-blog
17 verbose Windows_NT 6.1.7601
18 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "development"
19 verbose node v8.1.3
20 verbose npm  v5.0.3
21 error code ELIFECYCLE
22 error errno 1
23 error @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
23 error Exit status 1
24 error Failed at the @ development script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]

Please or to participate in this conversation.