Why am I getting errors with npm run dev while developing apps?

Hi,

I am new to develope shopify apps, and got some trouble when following the tutorial to build an example app.

Got the following errors when using “npm run dev”:

── external error ──

Error coming from composer serve

Command failed with exit code 255: composer serve

Composer\Config::disableProcessTimeout

php artisan serve

PHP Warning: require(/Users/Ak/test/web/vendor/autoload.php): Failed to open stream: No such file or directory in

/Users/Ak/test/web/artisan on line 18

PHP Fatal error: Uncaught Error: Failed opening required ‘/Users/Ak/test/web/vendor/autoload.php’

(include_path=‘.:/opt/homebrew/Cellar/php/8.1.5/share/php/pear’) in /Users/Ak/test/web/artisan:18

Stack trace:

#0 {main}

thrown in /Users/Ak/test/web/artisan on line 18

Script php artisan serve handling the serve event returned with error code 255

Warning: require(/Users/Ak/test/web/vendor/autoload.php): Failed to open stream: No such file or directory in

/Users/Ak/test/web/artisan on line 18

Fatal error: Uncaught Error: Failed opening required ‘/Users/Ak/test/web/vendor/autoload.php’

(include_path=‘.:/opt/homebrew/Cellar/php/8.1.5/share/php/pear’) in /Users/Ak/test/web/artisan:18

Stack trace:

#0 {main}

thrown in /Users/Ak/test/web/artisan on line 18

Can anyone help me to fix it? Thanks a lot.

I got the answer myself.

That was my fault, I should set up Laravel app first.

https://github.com/Shopify/shopify-app-template-php#setting-up-your-laravel-app

1 Like