0

i am new in Laravel and npm, When i try to run "npm run watch" in command line of my Laravel proyect i got this

NPM error mix.js() is missing required parameter 1: entry at Function.js

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! /root/.npm/_logs/2021-01-29T04_31_51_161Z-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! /root/.npm/_logs/2021-01-29T04_31_51_240Z-debug.log*

i do not know what is this and how to solve it, any help in how to solve this? thank you very much in advance and support

6
  • what is your node versions ? node -v you can check by Commented Jan 29, 2021 at 4:53
  • when i apply in command line "node -v" it appears v10.19.0 Commented Jan 29, 2021 at 4:55
  • 1
    update that nodejs.org/en then run all cmd Commented Jan 29, 2021 at 4:56
  • After update nodejs to v15.7.0 and npm to 7.4.3 and type in command line "npm run watch" i got this message AssertionError [ERR_ASSERTION]: mix.js() is missing required parameter 1: entry npm ERR! code 1 pm ERR! command sh -c cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch" Commented Jan 29, 2021 at 5:20
  • when did you get that error? Did you change your webpack.mix.js file? Commented Jan 29, 2021 at 5:21

1 Answer 1

1

Laravel's mix.js() takes at least one parameter. In the project root directory look at webpack.mix.js file, and then check mix.js().

For example mix.js('resources/js/app.js', 'public/assets/js/generated');

For more information you can visit documentation.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you, i already solved my problem, changing webpack.mix.jx, i guess it was corrupt i changed this archive with another webpack.mx.jx arrchive that was correct, thank you very much

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.