Laravel ‘cross-env’ Is Not Recognized as An Internal or External Command

The other days when I changed the development environment for my Laravel 7 application, from MacBook to Windows, I started to have a problem. When I tried to use npm for Laravel Mix, the following error kept it from working,

Laravel ‘cross-env’ Is Not Recognized as An Internal or External Command.

After I googled it and read some Stackoverflow posts I found that you need to do the following steps:

  • Delete node_modules folder from your project.
  • Run in your terminal or command prompt the following command
npm install --global cross-env
  • Delete “cross-env”: “^5.0.1”, from package.json file devDependencies section.
  • After deletion run
npm install --no-bin-links
  • In the end run
npm run dev

and see what happens

Join the ConversationLeave a reply

Your email address will not be published. Required fields are marked *

Comment*

Name*

Website