npm install && npm run dev isnt working in laravel

hi i just install the node.js and try to run this command in laravel 8

npm install && npm run dev

(note: i install node.js in D:)
This is the complete installation

paste.ofcode.org/ZC8e7KP6v7gYrAxqHBFjpk

but it gives this error:

  npm ERR! code ELIFECYCLE
  npm ERR! errno 1
  npm ERR! @ development: `mix`
  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:UsersjohnAppDataRoamingnpm-cache_logs
  2021-04-24T07_04_58_823Z-debug.log
  npm ERR! code ELIFECYCLE
  npm ERR! errno 1
  npm ERR! @ dev: `npm run development`
  npm ERR! Exit status 1
  npm ERR!
  npm ERR! Failed at the @ dev 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:UsersjohnAppDataRoamingnpm-cache_logs
  2021-04-24T07_04_59_173Z-debug.log

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

First, try to update your node.js file and then run “npm run dev” and if you again faced the same problem follow the following steps:

Step1: composer update
Step2: rm -rf node_modules
Step3: npm cache clean
Step4: npm install
Step5: npm outdated

In this step, it will update your laravel-mix version, it is in the package.json.

Step6: npm install
Step7: npm run dev

After all these steps, everything is good. I hope it solves your problem.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x