Laravel-mix: Command cross-env not found on Windows

Created on 22 Jan 2017  路  8Comments  路  Source: JeffreyWay/laravel-mix

I've got this issue when running this command npm run dev.

npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! [email protected] dev: `cross-env NODE_ENV=development webpack --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev script 'cross-env NODE_ENV=development webpack --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the project package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     cross-env NODE_ENV=development webpack --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs project
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls project
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     d:\Dev\Servers\wamp\www\project.dev\npm-debug.log

Note:

  • I'm using Windows 8.1
  • I've installed the node dependencies with yarn.

Most helpful comment

Install it globally That's like I did with npm npm i -g cross-env the same for webpack@^2.2.0 and webpack-dev-server@^2.2.0

All 8 comments

Install it globally That's like I did with npm npm i -g cross-env the same for webpack@^2.2.0 and webpack-dev-server@^2.2.0

It's a yarn issue, use npm install for the time being. See #94.

Thanks everyone, it was a yarn issue. Solved by using npm install command 馃憤

Update your npm to the newest
npm i -g npm

try this:

npm clean cache --force
and from the root directory project run "npm install"
and try to run "npm run dev"

Anyone facing the same issue on Windows (currently using Windows 10 X64), make sure to download the X64 installer of npm, then using your CMD, navigate to your project root folder and run npm install then npm run development and finally run npm run watch. It should work! Good luck and Code Away!

Install it globally That's like I did with npm npm i -g cross-env the same for webpack@^2.2.0 and webpack-dev-server@^2.2.0

npm clean-install worked for me since npm clean doesn't look to be a command in v6.11.3.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mementoneli picture mementoneli  路  3Comments

Bomavi picture Bomavi  路  3Comments

jpmurray picture jpmurray  路  3Comments

jpriceonline picture jpriceonline  路  3Comments

Cheddam picture Cheddam  路  3Comments