Running npm for laravel application

I am trying to run npm run watch in order to implement the changes I performed in my assets files but it isn't working. I am creating a laravel tool.

I have installed npm without any errors but when I run npm run watch I got the following error. Thanks for the help.

 > npm run development -- --watch > @ development C:\Users\\Documents\tool > cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch" 'cross-env' is not recognized as an internal or external command, operable program or batch file. 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 "--watch"` 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: npm ERR! C:\Users\AppData\Roaming\npm-cache\_logs\2019-08-13T08_58_29_406Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @ watch: `npm run development -- --watch` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @ watch 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! C:\Users\AppData\Roaming\npm-cache\_logs\2019-08-13T08_58_29_436Z-debug.log

1 Answer

you'r missing corss-env node module

try following

  1. Delete node_modules folder from your project
  2. Run this command npm install --global cross-env.
  3. Delete "cross-env": "^5.0.1", from package.json file devDependencies section.
  4. Run npm install --no-bin-links
  5. Now run npm run dev

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like