Skip to content

Failing to get started with a fresh installation... #3775

@Canowyrms

Description

@Canowyrms

Link to reproduction

No response

Describe the Bug

Hello. I'm trying to spin up Payload to play around with it. To the best of my knowledge, I'm following the installation instructions as they're written, but I'm encountering some issues... I did search here and Google before writing this, but I wasn't able to find anything related :\

Node: v18.18.2
NPM: 10.2.0
Yarn: 4.0.0-rc.53
(Above installed via Volta, if that matters.)
Ubuntu 22.04.03 LTS on WSL2 on Win10.
Docker Desktop: v4.24.2 (using WSL2 backend)


Not sure if this is an issue with Payload itself or with Yarn/whatever package manager it decides to use with npx create-payload-app (it's not clear to me which one is being used during this process). After creating the Payload app and cding in, I run yarn dev, like it says, and I get some error output that the app crashed.

Expand for terminal output
bk@wsl ~/code/sandbox
$ npx create-payload-app -n payload-cms-sandbox -t website

  Welcome to Payload. Let's create a project!

✔ Select a database › MongoDB
✔ Enter MongoDB connection string … mongodb://127.0.0.1/payload-cms-sandbox

  Creating project in /home/bk/code/sandbox/payload-cms-sandbox

✔ Dependencies installed
✔ .env file created
✔ Payload project successfully created

  ★ Launch Application:

    - cd ./payload-cms-sandbox
    - yarn dev or follow directions in README.md: file:///home/bk/code/sandbox/payload-cms-sandbox/README.md

  ★ Documentation:

    - Getting Started: https://payloadcms.com/docs/getting-started/what-is-payload
    - Configuration: https://payloadcms.com/docs/configuration/overview



bk@wsl ~/code/sandbox
$ cd payload-cms-sandbox/

bk@wsl ~/code/sandbox/payload-cms-sandbox
$ yarn dev
[nodemon] 2.0.22
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: ts
[nodemon] starting `ts-node src/server.ts -- -I`
unhandledRejection Error: mongoose-aggregate-paginate-v2 tried to access mongoose, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Required package: mongoose
Required by: mongoose-aggregate-paginate-v2@npm:1.0.6 (via /home/bk/.yarn/berry/cache/mongoose-aggregate-paginate-v2-npm-1.0.6-df5a3d46e2-10c0.zip/node_modules/mongoose-aggregate-paginate-v2/)

Require stack:
- /home/bk/.yarn/berry/cache/mongoose-aggregate-paginate-v2-npm-1.0.6-df5a3d46e2-10c0.zip/node_modules/mongoose-aggregate-paginate-v2/index.js
- /home/bk/code/sandbox/payload-cms-sandbox/.yarn/__virtual__/@payloadcms-db-mongodb-virtual-4fb9dbaf43/4/.yarn/berry/cache/@payloadcms-db-mongodb-npm-1.0.4-5a642e2349-10c0.zip/node_modules/@payloadcms/db-mongodb/dist/init.js
- /home/bk/code/sandbox/payload-cms-sandbox/.yarn/__virtual__/@payloadcms-db-mongodb-virtual-4fb9dbaf43/4/.yarn/berry/cache/@payloadcms-db-mongodb-npm-1.0.4-5a642e2349-10c0.zip/node_modules/@payloadcms/db-mongodb/dist/index.js
- /home/bk/code/sandbox/payload-cms-sandbox/src/payload/payload.config.ts
- /home/bk/.yarn/berry/cache/payload-npm-2.0.11-0230c0b9cd-10c0.zip/node_modules/payload/dist/config/load.js
- /home/bk/.yarn/berry/cache/payload-npm-2.0.11-0230c0b9cd-10c0.zip/node_modules/payload/dist/payload.js
- /home/bk/.yarn/berry/cache/payload-npm-2.0.11-0230c0b9cd-10c0.zip/node_modules/payload/dist/initHTTP.js
- /home/bk/.yarn/berry/cache/payload-npm-2.0.11-0230c0b9cd-10c0.zip/node_modules/payload/dist/index.js
- /home/bk/code/sandbox/payload-cms-sandbox/src/server.ts
    at Function.require$$0.Module._resolveFilename (/home/bk/code/sandbox/payload-cms-sandbox/.pnp.cjs:22531:13)
    at Function.call (/home/bk/.yarn/berry/cache/@cspotcode-source-map-support-npm-0.8.1-964f2de99d-10c0.zip/node_modules/@cspotcode/source-map-support/source-map-support.js:811:30)
    at /home/bk/code/sandbox/payload-cms-sandbox/.yarn/__virtual__/next-virtual-afab771527/4/.yarn/berry/cache/next-npm-13.5.6-306005c39c-10c0.zip/node_modules/next/src/server/require-hook.ts:50:34
    at Function.Module._load (node:internal/modules/cjs/loader:922:27)
    at Function.require$$0.Module._load (/home/bk/code/sandbox/payload-cms-sandbox/.pnp.cjs:22422:31)
    at Module.call (node:internal/modules/cjs/loader:1143:19)
    at Module.mod.require (/home/bk/code/sandbox/payload-cms-sandbox/.yarn/__virtual__/next-virtual-afab771527/4/.yarn/berry/cache/next-npm-13.5.6-306005c39c-10c0.zip/node_modules/next/src/server/require-hook.ts:69:26)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/home/bk/.yarn/berry/cache/mongoose-aggregate-paginate-v2-npm-1.0.6-df5a3d46e2-10c0.zip/node_modules/mongoose-aggregate-paginate-v2/index.js:1:18)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
[nodemon] app crashed - waiting for file changes before starting...

I also tried to get started by using the included docker-compose.yml... I had some problems there, too.

bk@wsl ~/code/sandbox/payload-cms-sandbox
$ docker-compose up
[truncated]
payload-cms-sandbox-payload-1  | [03:12:18] ERROR (payload): Error: cannot connect to MongoDB. Details: connect ECONNREFUSED 127.0.0.1:27017

Over in the browser, hitting http://127.0.0.1:3000 returns an error:

The connection to the server was reset while the page was loading.


What am I doing wrong? How am I managing to fail two different ways?

To Reproduce

  1. Run npx create-payload-app -n payload-cms-sandbox -t website
  2. Run cd payload-cms-sandbox
  3. Run yarn dev
  4. App crashes

  1. Run npx create-payload-app -n payload-cms-sandbox -t website
  2. Run cd payload-cms-sandbox
  3. Run docker-compose up
  4. Watch terminal for error trying to connect to MongoDB.
  5. Request http://127.0.0.1:3000 in the browser, receive 'connection reset' error.

Payload Version

Latest?

Adapters and Plugins

No response

Metadata

Metadata

Assignees

Labels

status: needs-triagePossible bug which hasn't been reproduced yet

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions