Laravel 7: Unable to Run Dev on Fresh Install

  laravel, node.js, npm, php

I am currently performing these terminal commands:

  1. composer create-project –prefer-dist laravel/laravel:^7.0
  2. composer require laravel/ui:^2.4
  3. php artisan ui bootstrap –auth
  4. npm install && npm run dev

This returns the following error

sh: mix: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! @ development: `mix`
npm ERR! spawn ENOENT
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!     /home/jonahmar/.npm/_logs/2021-02-23T15_46_54_252Z-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!     /home/jonahmar/.npm/_logs/2021-02-23T15_46_54_277Z-debug.log

I am unable to fix or identify the issue, I have performed the following in an attempt to fix the issue:

  1. npm rebuild node-sass
  2. npm install –global cross-env
  3. npm cache clean –force
  4. npm install laravel-mix –save-dev

To no avail, I am also getting a warning prior to running this command:

npm WARN lifecycle The node binary used for scripts is /home/jonahmar/nodevenv/onyx.website.io/12/bin/node but npm is using /opt/alt/alt-nodejs12/root/usr/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

The current web-server is Litespeed Enterprise, with the latest version of composer, and node.

Source: Laravel

Leave a Reply