Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

npm 'missing script payload'

default discord avatar
jennifilmlast year
1

Kia ora!



I'm running payload via the Astroad docker containers, and am struggling to get migrations working.



I initially had a unique 'slug' field in some collections I realised I didn't need, so I removed it from my payload config. I'm running into issues (getting the 'slug not unique' error) so I assume MongoDB is unhappy because it's still expecting a unique slug. I want to run a migration to remove this field totally.



However, after adding the 'payload' script to package.json, trying to run 'npm run payload migrate' gives me a 'missing script: "payload"' error.



I'm running payload 2.1

  • discord user avatar
    denolfe
    last year

    This script should be included in all of our templates.



    If you happen to not have it, this is what needs to exist in your package.json's scripts (or similar):



    {
      "scripts": {
        "payload": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload"
      }
    }


    Some more detail here if you need it:

    https://github.com/payloadcms/payload/releases/tag/v2.0.0
Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.