leomorpho / goship

Opinionated Go/HTMX boilerplate with payments, emails, auth, notifications and more!⛵️
http://goship.run
MIT License
301 stars 12 forks source link

'make init' => Cannot find package 'esbuild' && overmind: No such file or directory #5

Open bartonhammond opened 5 days ago

bartonhammond commented 5 days ago

Thanks for making this available!

cloned and ran make init

GoShip$ make init
make reset
docker-compose down
make up
docker-compose up -d --remove-orphans
[+] Running 12/2
 ✔ cache 7 layers [⣿⣿⣿⣿⣿⣿⣿]      0B/0B      Pulled                                                            6.7s 
 ✔ mailpit 3 layers [⣿⣿⣿]      0B/0B      Pulled                                                              3.9s 
[+] Building 0.0s (0/0)                                                                       docker:desktop-linux
[+] Running 3/3
 ✔ Network goship_default    Created                                                                          0.0s 
 ✔ Container goship_cache    Started                                                                          0.1s 
 ✔ Container goship_mailpit  Started                                                                          0.1s 
sleep 3
make build-js 
npm run build

> amie@1.0.0 build
> node build.mjs

node:internal/modules/esm/resolve:844
  throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base), null);
        ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'esbuild' imported from /Users/bartonhammond/projects/go/GoShip/build.mjs
    at packageResolve (node:internal/modules/esm/resolve:844:9)
    at moduleResolve (node:internal/modules/esm/resolve:901:20)
    at defaultResolve (node:internal/modules/esm/resolve:1121:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:396:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:365:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:240:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:85:39)
    at link (node:internal/modules/esm/module_job:84:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}

Node.js v21.1.0
make[1]: *** [build-js] Error 1
make: *** [init] Error 2

so I did npm install and ran make init again with the following:

GoShip$ npm install
npm WARN deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm WARN deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm WARN deprecated glob@8.1.0: Glob versions prior to v9 are no longer supported
npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm WARN deprecated @types/expect@24.3.0: This is a stub types definition. expect provides its own type definitions, so you do not need this installed.

added 891 packages, and audited 892 packages in 24s

131 packages are looking for funding
  run `npm fund` for details

15 vulnerabilities (3 low, 6 moderate, 6 high)

To address issues that do not require attention, run:
  npm audit fix

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
GoShip$ make init
make reset
docker-compose down
[+] Running 3/2
 ✔ Container goship_cache    Removed                                                                          0.1s 
 ✔ Container goship_mailpit  Removed                                                                          0.4s 
 ✔ Network goship_default    Removed                                                                          0.0s 
make up
docker-compose up -d --remove-orphans
[+] Building 0.0s (0/0)                                                                       docker:desktop-linux
[+] Running 3/3
 ✔ Network goship_default    Created                                                                          0.0s 
 ✔ Container goship_cache    Started                                                                          0.0s 
 ✔ Container goship_mailpit  Started                                                                          0.0s 
sleep 3
make build-js 
npm run build

> amie@1.0.0 build
> node build.mjs

Svelte entry points: [ 'javascript/svelte/main.js' ]
▲ [WARNING] NotificationPermissions has unused export property 'addSmsSubscriptionEndpoint'. If it is for external reference only, please consider using `export const addSmsSubscriptionEndpoint` [plugin esbuild-svelte]

    javascript/svelte/components/NotificationPermissions.svelte:20:13:
      20 │   export let addSmsSubscriptionEndpoint = "";
         ╵              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  The plugin "esbuild-svelte" was triggered by this import

    javascript/svelte/main.js:3:36:
      3 │ import NotificationPermissions from "./components/NotificationPermissions.svelte";
        ╵                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

▲ [WARNING] NotificationPermissions has unused export property 'deleteSmsSubscriptionEndpoint'. If it is for external reference only, please consider using `export const deleteSmsSubscriptionEndpoint` [plugin esbuild-svelte]

    javascript/svelte/components/NotificationPermissions.svelte:21:13:
      21 │   export let deleteSmsSubscriptionEndpoint = "";
         ╵              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  The plugin "esbuild-svelte" was triggered by this import

    javascript/svelte/main.js:3:36:
      3 │ import NotificationPermissions from "./components/NotificationPermissions.svelte";
        ╵                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

▲ [WARNING] NotificationPermissions has unused export property 'phoneSubscriptionEnabled'. If it is for external reference only, please consider using `export const phoneSubscriptionEnabled` [plugin esbuild-svelte]

    javascript/svelte/components/NotificationPermissions.svelte:22:13:
      22 │   export let phoneSubscriptionEnabled = false;
         ╵              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  The plugin "esbuild-svelte" was triggered by this import

    javascript/svelte/main.js:3:36:
      3 │ import NotificationPermissions from "./components/NotificationPermissions.svelte";
        ╵                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

▲ [WARNING] Unused CSS selector "dialog::backdrop" [plugin esbuild-svelte]

    javascript/svelte/components/PwaInstallButton.svelte:145:2:
      145 │   dialog::backdrop {
          ╵   ~~~~~~~~~~~~~~~~

  The plugin "esbuild-svelte" was triggered by this import

    javascript/svelte/main.js:6:29:
      6 │ import PwaInstallButton from "./components/PwaInstallButton.svelte";
        ╵                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Build completed successfully
make build-css 
npx tailwindcss -i ./styles/styles.css -o ./static/styles_bundle.css
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme

Rebuilding...

🌼   daisyUI 4.7.2
├─ ⚠︎  Error  Invalid color  in tailwind.config.js
├─ ✔︎ 2 themes added             https://daisyui.com/docs/themes
╰─ ★ Star daisyUI on GitHub     https://github.com/saadeghi/daisyui

Done in 616ms.
make seed 
go run cmd/seed/main.go
go: downloading entgo.io/ent v0.14.0
go: downloading github.com/rs/zerolog v1.29.1
go: downloading ariga.io/atlas v0.20.1-0.20240321075817-75fd3b1accbf
go: downloading github.com/eko/gocache/v2 v2.3.1
go: downloading golang.org/x/crypto v0.26.0
go: downloading github.com/getsentry/sentry-go v0.26.0
go: downloading github.com/go-redis/redis/v8 v8.11.6-0.20220405070650-99c79f7041fc
go: downloading github.com/go-playground/validator/v10 v10.16.0
go: downloading github.com/hibiken/asynq v0.24.1
go: downloading github.com/jackc/pgx/v4 v4.18.1
go: downloading github.com/labstack/echo-contrib v0.15.0
go: downloading github.com/labstack/echo/v4 v4.11.4
go: downloading github.com/mattn/go-sqlite3 v1.14.23
go: downloading github.com/stripe/stripe-go/v78 v78.6.0
go: downloading github.com/ziflex/lecho/v3 v3.5.0
go: downloading github.com/jackc/pgx v3.6.2+incompatible
go: downloading github.com/minio/minio-go/v7 v7.0.67
go: downloading github.com/AfterShip/email-verifier v1.3.3
go: downloading github.com/deckarep/golang-set/v2 v2.6.0
go: downloading github.com/orsinium-labs/enum v1.3.0
go: downloading firebase.google.com/go/v4 v4.14.1
go: downloading github.com/SherClockHolmes/webpush-go v1.3.0
go: downloading github.com/aws/aws-sdk-go-v2 v1.18.1
go: downloading github.com/aws/aws-sdk-go-v2/config v1.18.27
go: downloading github.com/aws/aws-sdk-go-v2/service/sns v1.20.13
go: downloading github.com/gofrs/uuid v4.2.0+incompatible
go: downloading google.golang.org/api v0.183.0
go: downloading github.com/disintegration/imaging v1.6.2
go: downloading github.com/spf13/viper v1.17.0
go: downloading github.com/XiaoMi/pegasus-go-client v0.0.0-20210427083443-f3b6b08bc4c2
go: downloading github.com/bradfitz/gomemcache v0.0.0-20220106215444-fb4bf637b56d
go: downloading github.com/vmihailenco/msgpack v4.0.4+incompatible
go: downloading golang.org/x/sys v0.23.0
go: downloading github.com/a-h/templ v0.2.771
go: downloading github.com/resend/resend-go/v2 v2.5.0
go: downloading github.com/nats-io/nats.go v1.33.1
go: downloading github.com/gabriel-vasile/mimetype v1.4.2
go: downloading github.com/leodido/go-urn v1.2.4
go: downloading golang.org/x/text v0.17.0
go: downloading golang.org/x/net v0.28.0
go: downloading github.com/gorilla/context v1.1.1
go: downloading github.com/stretchr/objx v0.5.2
go: downloading github.com/cespare/xxhash/v2 v2.2.0
go: downloading github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f
go: downloading github.com/jackc/pgconn v1.14.0
go: downloading github.com/jackc/pgtype v1.14.0
go: downloading github.com/json-iterator/go v1.1.12
go: downloading github.com/klauspost/compress v1.17.7
go: downloading github.com/minio/md5-simd v1.1.2
go: downloading github.com/minio/sha256-simd v1.0.1
go: downloading github.com/redis/go-redis/v9 v9.0.3
go: downloading github.com/robfig/cron/v3 v3.0.1
go: downloading github.com/hbollon/go-edlib v1.6.0
go: downloading github.com/prometheus/client_golang v1.17.0
go: downloading github.com/aws/smithy-go v1.13.5
go: downloading cloud.google.com/go/firestore v1.15.0
go: downloading github.com/aws/aws-sdk-go-v2/credentials v1.13.26
go: downloading cloud.google.com/go v0.114.0
go: downloading github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.4
go: downloading github.com/aws/aws-sdk-go-v2/internal/ini v1.3.35
go: downloading github.com/aws/aws-sdk-go-v2/service/sso v1.12.12
go: downloading github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.12
go: downloading github.com/aws/aws-sdk-go-v2/service/sts v1.19.2
go: downloading github.com/hashicorp/hcl/v2 v2.18.1
go: downloading github.com/zclconf/go-cty v1.14.1
go: downloading github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.34
go: downloading golang.org/x/image v0.15.0
go: downloading github.com/cenkalti/backoff/v4 v4.3.0
go: downloading gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637
go: downloading k8s.io/apimachinery v0.26.2
go: downloading github.com/jackc/pgproto3/v2 v2.3.2
go: downloading github.com/jackc/pgio v1.0.0
go: downloading github.com/nats-io/nkeys v0.4.7
go: downloading github.com/nats-io/nuid v1.0.1
go: downloading github.com/rs/xid v1.5.0
go: downloading github.com/golang/protobuf v1.5.4
go: downloading google.golang.org/protobuf v1.34.1
go: downloading github.com/jackc/chunkreader/v2 v2.0.1
go: downloading github.com/jackc/pgpassfile v1.0.0
go: downloading github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a
go: downloading github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
go: downloading github.com/modern-go/reflect2 v1.0.2
go: downloading github.com/klauspost/cpuid/v2 v2.2.6
go: downloading github.com/beorn7/perks v1.0.1
go: downloading github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16
go: downloading github.com/prometheus/common v0.44.0
go: downloading github.com/prometheus/procfs v0.11.1
go: downloading github.com/MicahParks/keyfunc v1.9.0
go: downloading github.com/golang-jwt/jwt/v4 v4.5.0
go: downloading golang.org/x/oauth2 v0.21.0
go: downloading cloud.google.com/go/storage v1.41.0
go: downloading github.com/go-openapi/inflect v0.19.0
go: downloading github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.28
go: downloading github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.28
go: downloading github.com/pelletier/go-toml/v2 v2.1.0
go: downloading google.golang.org/genproto v0.0.0-20240604185151-ef581f913117
go: downloading github.com/googleapis/gax-go/v2 v2.12.4
go: downloading google.golang.org/grpc v1.64.0
go: downloading github.com/pegasus-kv/thrift v0.13.0
go: downloading github.com/sirupsen/logrus v1.9.3
go: downloading gopkg.in/natefinch/lumberjack.v2 v2.0.0
go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.4
go: downloading cloud.google.com/go/longrunning v0.5.7
go: downloading google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117
go: downloading google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117
go: downloading cloud.google.com/go/compute/metadata v0.3.0
go: downloading cloud.google.com/go/iam v1.1.8
go: downloading go.opencensus.io v0.24.0
go: downloading go.opentelemetry.io/otel/trace v1.27.0
go: downloading go.opentelemetry.io/otel v1.27.0
go: downloading cloud.google.com/go/auth v0.5.1
go: downloading cloud.google.com/go/auth/oauth2adapt v0.2.2
go: downloading go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0
go: downloading github.com/google/s2a-go v0.1.7
go: downloading github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
go: downloading go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0
go: downloading github.com/googleapis/enterprise-certificate-proxy v0.3.2
go: downloading go.opentelemetry.io/otel/metric v1.27.0
go: downloading github.com/felixge/httpsnoop v1.0.4
go: downloading github.com/go-logr/logr v1.4.2
go: downloading github.com/go-logr/stdr v1.2.2
make watch
overmind start
make[1]: overmind: No such file or directory
make[1]: *** [watch] Error 1
make: *** [init] Error 2
bartonhammond commented 5 days ago

Did brew install tmux & brew install overmind Ran make watch:

GoShip$ make watch
overmind start
make: overmind: No such file or directory
make: *** [watch] Error 1
GoShip$ make down
docker-compose down
[+] Running 3/2
 ✔ Container goship_mailpit  Removed                                                                          0.4s 
 ✔ Container goship_cache    Removed                                                                          0.2s 
 ✔ Network goship_default    Removed                                                                          0.0s 
GoShip$ make up
docker-compose up -d --remove-orphans
[+] Building 0.0s (0/0)                                                                       docker:desktop-linux
[+] Running 3/3
 ✔ Network goship_default    Created                                                                          0.0s 
 ✔ Container goship_mailpit  Started                                                                          0.0s 
 ✔ Container goship_cache    Started                                                                          0.0s 
sleep 3
air
watch-go        | make[1]: air: No such file or directory
watch-go        | make[1]: *** [watch-go] Error 1
watch-go        | Exited with code 2
watch-js        | Interrupting...
watch-css       | Interrupting...
watch-go-worker | Interrupting...
watch-js        | make[1]: *** [watch-js] Interrupt: 2
watch-css       | Exited with code 0
watch-go-worker | Exited with code 0
watch-js        | Exited with code 0
make: *** [watch] Error 2
bartonhammond commented 5 days ago

Ran go install github.com/air-verse/air@latest Started new shell (MacOS)

GoShip$ 
GoShip$ 
air
watch-go        | make[1]: air: No such file or directory
watch-go        | make[1]: *** [watch-go] Error 1
watch-go        | Exited with code 2
watch-js        | Interrupting...
watch-css       | Interrupting...
watch-go-worker | Interrupting...
watch-js        | make[1]: *** [watch-js] Interrupt: 2
watch-go-worker | Exited with code 0
watch-js        | Exited with code 0
watch-css       | Exited with code 0
make: *** [watch] Error 2
GoShip$ 

This is first time ever using golang so I'm lost.

bartonhammond commented 5 days ago

so added the following to .zshrc alias air='$(go env GOPATH)/bin/air Then reopen terminal and run make watch:

air
watch-go        | make[1]: air: No such file or directory
watch-go        | make[1]: *** [watch-go] Error 1
watch-go        | Exited with code 2
watch-css       | npx tailwindcss -i ./styles/styles.css -o ./static/styles_bundle.css --watch
watch-js        | Interrupting...
watch-css       | Interrupting...
watch-go-worker | Interrupting...
watch-css       | make[1]: *** [watch-css] Interrupt: 2
watch-js        | make[1]: *** [watch-js] Interrupt: 2
watch-go-worker | Exited with code 0
watch-css       | Exited with code 0
watch-js        | Exited with code 0
make: *** [watch] Error 2

So I try just entering air.

GoShip$ air

  __    _   ___  
 / /\  | | | |_) 
/_/--\ |_| |_| \_ v1.61.1, built with Go go1.23.2

mkdir /Users/bartonhammond/projects/go/GoShip/tmp
watching .
watching cmd
watching cmd/seed
watching cmd/web
watching cmd/worker
watching config
watching config/firewalls
watching data
watching dbs
watching deploy
watching deploy/kamal
!exclude e2e_tests
watching ent
watching ent/emailsubscription
watching ent/emailsubscriptiontype
watching ent/emojis
watching ent/enttest
watching ent/fcmsubscriptions
watching ent/filestorage
watching ent/hook
watching ent/image
watching ent/imagesize
watching ent/invitation
watching ent/lastseenonline
watching ent/migrate
watching ent/migrate/migrations
watching ent/monthlysubscription
watching ent/notification
watching ent/notificationpermission
watching ent/notificationtime
watching ent/passwordtoken
watching ent/phoneverificationcode
watching ent/predicate
watching ent/profile
watching ent/pwapushsubscription
watching ent/runtime
watching ent/schema
watching ent/sentemail
watching ent/user
!exclude javascript
!exclude node_modules
watching pgvector-image
watching pkg
watching pkg/context
watching pkg/controller
watching pkg/domain
watching pkg/funcmap
watching pkg/htmx
watching pkg/middleware
watching pkg/repos
watching pkg/repos/emailsmanager
watching pkg/repos/mailer
watching pkg/repos/msg
watching pkg/repos/notifierrepo
watching pkg/repos/profilerepo
watching pkg/repos/pubsub
watching pkg/repos/storage
watching pkg/repos/subscriptions
watching pkg/routing
watching pkg/routing/routenames
watching pkg/routing/routes
watching pkg/services
watching pkg/tasks
watching pkg/tests
watching pkg/types
!exclude pwabuilder-ios-wrapper
!exclude scripts
watching seeder
watching static
watching styles
watching templates
watching templates/components
watching templates/emails
watching templates/helpers
watching templates/layouts
watching templates/pages
!exclude testdata
!exclude tmp
building...
/bin/sh: templ: command not found
failed to build, error: exit status 127
running...
/bin/sh: /Users/bartonhammond/projects/go/GoShip/tmp/main: No such file or directory
Process Exit with Code: 127
bartonhammond commented 5 days ago

So installed templ with go install github.com/a-h/templ/cmd/templ@latest and added alias templ='$(go env GOPATH)/bin/templ' to .zshrc and restarted terminal

When I do make watch the final display is this:

air
watch-go        | make[1]: air: No such file or directory
watch-go        | make[1]: *** [watch-go] Error 1
watch-go        | Exited with code 2
watch-js        | Interrupting...
watch-css       | Interrupting...
watch-go-worker | Interrupting...
watch-js        | make[1]: *** [watch-js] Interrupt: 2
watch-css       | Exited with code 0
watch-js        | Exited with code 0
watch-go-worker | Exited with code 0
make: *** [watch] Error 2
GoShip$