heroku laravel - vite not found

Viewed 79

Any help/guidance thank you in advance.

Today I've set up a Heroku dyno, but can't get the vite command to run.

Laravel 9.29, NodeJS 8.15

Trying to run heroku run npm run dev but returns /tmp/dev-3799b748.sh: 1: vite: not found

I've set the build packs to:

heroku buildpacks
=== manage-demo Buildpack URLs

  1. heroku/nodejs
  2. heroku/php

Also the Config Vars NPM_CONFIG_PRODUCTION = false, YARN_PRODUCTION = false

Commands used to create the Laravel Project:

composer create-project laravel/laravel <myprojectname>
composer require laravel/breeze
php artisan breeze:install react
php artisan migrate
npm install

Deploy Branch

-----> Building on the Heroku-22 stack
-----> Using buildpacks:
       1. heroku/nodejs
       2. heroku/php
-----> Node.js app detected
       
-----> Creating runtime environment
       
       NPM_CONFIG_PRODUCTION=false
       NPM_CONFIG_LOGLEVEL=error
       USE_NPM_INSTALL=true
       NODE_VERBOSE=false
       NODE_ENV=production
       NODE_MODULES_CACHE=true
       
-----> Installing binaries
       engines.node (package.json):  unspecified
       engines.npm (package.json):   unspecified (use default)
       
       Resolving node version 16.x...
       Downloading and installing node 16.17.0...
       Using default npm version: 8.15.0
       
-----> Restoring cache
       - node_modules (not cached - skipping)
       
-----> Installing dependencies
       Installing node modules (package.json + package-lock)
       
       added 165 packages, and audited 166 packages in 3s
       
       25 packages are looking for funding
         run `npm fund` for details
       
       found 0 vulnerabilities
       
-----> Build
       Running build
       
       > build
       > vite build
       
       vite v3.1.0 building for production...
       transforming...
       ✓ 254 modules transformed.
       rendering chunks...
       public/build/manifest.json                        3.78 KiB
       public/build/assets/ConfirmPassword.6778c5aa.js   1.09 KiB / gzip: 0.61 KiB
       public/build/assets/InputLabel.b7560c9a.js        0.20 KiB / gzip: 0.18 KiB
       public/build/assets/TextInput.90051331.js         0.63 KiB / gzip: 0.39 KiB
       public/build/assets/PrimaryButton.63fa2720.js     0.82 KiB / gzip: 0.49 KiB
       public/build/assets/ApplicationLogo.4d214c56.js   3.06 KiB / gzip: 1.30 KiB
       public/build/assets/ForgotPassword.863d1afc.js    1.06 KiB / gzip: 0.62 KiB
       public/build/assets/Login.ffce380f.js             1.94 KiB / gzip: 0.89 KiB
       public/build/assets/Register.13d4ee0d.js          1.95 KiB / gzip: 0.76 KiB
       public/build/assets/ResetPassword.467e122e.js     1.57 KiB / gzip: 0.65 KiB
       public/build/assets/VerifyEmail.800ac39d.js       1.07 KiB / gzip: 0.61 KiB
       public/build/assets/Dashboard.c9f20060.js         17.64 KiB / gzip: 6.24 KiB
       public/build/assets/Welcome.875c53e4.js           11.94 KiB / gzip: 3.72 KiB
       public/build/assets/app.5c62c80a.css              22.06 KiB / gzip: 4.63 KiB
       public/build/assets/app.36a55110.js               315.09 KiB / gzip: 107.01 KiB
       
-----> Caching build
       - node_modules
       
-----> Pruning devDependencies
       Skipping because NPM_CONFIG_PRODUCTION is 'false'
       
-----> Build succeeded!
-----> PHP app detected
-----> Bootstrapping...
-----> Preparing platform package installation...
-----> Installing platform packages...
       - php (8.1.10)
       - apache (2.4.54)
       - composer (2.4.1)
       - nginx (1.22.0)
       NOTICE: detected userland polyfill packages for PHP extensions
       NOTICE: now attempting to install native extension packages
       Installing extensions provided by symfony/polyfill-mbstring:
       - ext-mbstring... 
       Installing extensions provided by symfony/polyfill-ctype:
       - ext-ctype... 
-----> Installing dependencies...
       Composer version 2.4.1 2022-08-20 11:44:50
       Installing dependencies from lock file
       Verifying lock file contents can be installed on current platform.
       Package operations: 70 installs, 0 updates, 0 removals
         - Installing doctrine/inflector (2.0.5): Extracting archive
         - Installing doctrine/lexer (1.2.3): Extracting archive
         - Installing symfony/polyfill-ctype (v1.26.0): Extracting archive
         - Installing webmozart/assert (1.11.0): Extracting archive
         - Installing dragonmantank/cron-expression (v3.3.2): Extracting archive
         - Installing symfony/polyfill-mbstring (v1.26.0): Extracting archive
         - Installing symfony/deprecation-contracts (v3.1.1): Extracting archive
         - Installing symfony/http-foundation (v6.1.4): Extracting archive
         - Installing fruitcake/php-cors (v1.2.0): Extracting archive
         - Installing psr/http-message (1.0.1): Extracting archive
         - Installing psr/http-client (1.0.1): Extracting archive
         - Installing ralouphie/getallheaders (3.0.3): Extracting archive
         - Installing psr/http-factory (1.0.1): Extracting archive
         - Installing guzzlehttp/psr7 (2.4.1): Extracting archive
         - Installing guzzlehttp/promises (1.5.2): Extracting archive
         - Installing guzzlehttp/guzzle (7.5.0): Extracting archive
         - Installing voku/portable-ascii (2.0.1): Extracting archive
         - Installing symfony/polyfill-php80 (v1.26.0): Extracting archive
         - Installing phpoption/phpoption (1.9.0): Extracting archive
         - Installing graham-campbell/result-type (v1.1.0): Extracting archive
         - Installing vlucas/phpdotenv (v5.4.1): Extracting archive
         - Installing symfony/css-selector (v6.1.3): Extracting archive
         - Installing tijsverkoyen/css-to-inline-styles (2.2.4): Extracting archive
         - Installing symfony/var-dumper (v6.1.3): Extracting archive
         - Installing symfony/routing (v6.1.3): Extracting archive
         - Installing symfony/process (v6.1.3): Extracting archive
         - Installing symfony/polyfill-php72 (v1.26.0): Extracting archive
         - Installing symfony/polyfill-intl-normalizer (v1.26.0): Extracting archive
         - Installing symfony/polyfill-intl-idn (v1.26.0): Extracting archive
         - Installing symfony/mime (v6.1.4): Extracting archive
         - Installing psr/container (2.0.2): Extracting archive
         - Installing symfony/service-contracts (v3.1.1): Extracting archive
         - Installing psr/event-dispatcher (1.0.0): Extracting archive
         - Installing symfony/event-dispatcher-contracts (v3.1.1): Extracting archive
         - Installing symfony/event-dispatcher (v6.1.0): Extracting archive
         - Installing psr/log (3.0.0): Extracting archive
         - Installing egulias/email-validator (3.2.1): Extracting archive
         - Installing symfony/mailer (v6.1.4): Extracting archive
         - Installing symfony/error-handler (v6.1.3): Extracting archive
         - Installing symfony/http-kernel (v6.1.4): Extracting archive
         - Installing symfony/finder (v6.1.3): Extracting archive
         - Installing symfony/polyfill-intl-grapheme (v1.26.0): Extracting archive
         - Installing symfony/string (v6.1.4): Extracting archive
         - Installing symfony/console (v6.1.4): Extracting archive
         - Installing symfony/polyfill-php81 (v1.26.0): Extracting archive
         - Installing ramsey/collection (1.2.2): Extracting archive
         - Installing brick/math (0.10.2): Extracting archive
         - Installing ramsey/uuid (4.4.0): Extracting archive
         - Installing psr/simple-cache (3.0.0): Extracting archive
         - Installing nunomaduro/termwind (v1.14.0): Extracting archive
         - Installing symfony/translation-contracts (v3.1.1): Extracting archive
         - Installing symfony/translation (v6.1.4): Extracting archive
         - Installing nesbot/carbon (2.62.1): Extracting archive
         - Installing monolog/monolog (2.8.0): Extracting archive
         - Installing league/mime-type-detection (1.11.0): Extracting archive
         - Installing league/flysystem (3.3.0): Extracting archive
         - Installing nette/utils (v3.2.7): Extracting archive
         - Installing nette/schema (v1.2.2): Extracting archive
         - Installing dflydev/dot-access-data (v3.0.1): Extracting archive
         - Installing league/config (v1.1.1): Extracting archive
         - Installing league/commonmark (2.3.5): Extracting archive
         - Installing laravel/serializable-closure (v1.2.2): Extracting archive
         - Installing laravel/framework (v9.29.0): Extracting archive
         - Installing inertiajs/inertia-laravel (v0.6.3): Extracting archive
         - Installing laravel/breeze (v1.13.0): Extracting archive
         - Installing laravel/sanctum (v2.15.1): Extracting archive
         - Installing nikic/php-parser (v4.15.1): Extracting archive
         - Installing psy/psysh (v0.11.8): Extracting archive
         - Installing laravel/tinker (v2.7.2): Extracting archive
         - Installing tightenco/ziggy (v1.4.6): Extracting archive
       Generating optimized autoload files
       > Illuminate\Foundation\ComposerScripts::postAutoloadDump
       > @php artisan package:discover --ansi
       
          INFO  Discovering packages.  
       
         inertiajs/inertia-laravel ............................................. DONE
         laravel/breeze ........................................................ DONE
         laravel/sanctum ....................................................... DONE
         laravel/tinker ........................................................ DONE
         nesbot/carbon ......................................................... DONE
         nunomaduro/termwind ................................................... DONE
         tightenco/ziggy ....................................................... DONE
       
       49 packages you are using are looking for funding.
       Use the `composer fund` command to find out more!
-----> Preparing runtime environment...
-----> Checking for additional extensions to install...
-----> Discovering process types
       Procfile declares types -> web
-----> Compressing...
       Done: 66M
-----> Launching...
       Released v29
       https://manage-demo.herokuapp.com/ deployed to Heroku
Starting November 28th, 2022, free Heroku Dynos, free Heroku Postgres, and free Heroku Data for Redis® will no longer be available.
If you have apps using any of these resources, you must upgrade to paid plans by this date to ensure your apps continue to run and to retain your data. For students, we will announce a new program by the end of September. Learn more at https://blog.heroku.com/next-chapter

heroku run npm run dev

npm WARN config production Use `--omit=dev` instead.

> dev
> vite


  VITE v3.1.0  ready in 507 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
[..................] | : timing config:load:flatten Completed in 2ms
  LARAVEL v9.29.0  plugin v0.6.0

  ➜  APP_URL: https://manage-demo.herokuapp.com/
node:internal/errors:477 timing config:load:flatten Completed in 2ms
    ErrorCaptureStackTrace(err);
    ^

Error: ENOSPC: System limit for number of file watchers reached, watch '/app/.heroku/node/include/node/openssl/archs/linux-x86_64/asm/include/progs.h'
    at FSWatcher.<computed> (node:internal/fs/watchers:244:19)
    at Object.watch (node:fs:2301:34)
    at createFsWatchInstance (file:///app/node_modules/vite/dist/node/chunks/dep-665b0112.js:49738:17)
    at setFsWatchListener (file:///app/node_modules/vite/dist/node/chunks/dep-665b0112.js:49785:15)
    at NodeFsHandler$1._watchWithNodeFs (file:///app/node_modules/vite/dist/node/chunks/dep-665b0112.js:49940:14)
    at NodeFsHandler$1._handleFile (file:///app/node_modules/vite/dist/node/chunks/dep-665b0112.js:50004:23)
    at NodeFsHandler$1._addToNodeFs (file:///app/node_modules/vite/dist/node/chunks/dep-665b0112.js:50246:21)
Emitted 'error' event on FSWatcher instance at:
    at FSWatcher._handleError (file:///app/node_modules/vite/dist/node/chunks/dep-665b0112.js:51434:10)
    at NodeFsHandler$1._addToNodeFs (file:///app/node_modules/vite/dist/node/chunks/dep-665b0112.js:50254:18) {
  errno: -28,
  syscall: 'watch',
  code: 'ENOSPC',
  path: '/app/.heroku/node/include/node/openssl/archs/linux-x86_64/asm/include/progs.h',
  filename: '/app/.heroku/node/include/node/openssl/archs/linux-x86_64/asm/include/progs.h'
}
0 Answers
Related