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.

Can't build dev Docker image

default discord avatar
serominelast year
10

I'm getting the following error when trying to build from the template Docker image:



2.853 const stringWidth = require('string-width');


2.853 ^


2.853


2.853 Error [ERR_REQUIRE_ESM]: require() of ES Module /home/node/app/node_modules/string-width/index.js from /home/node/app/node_modules/cliui/build/index.cjs not supported.



It is not a package I've added. Appreciate any help!

  • default discord avatar
    notchrlast year
    @526395515886239747

    I believe this is a yarn issue



    are you using yarn v2?



    Another use had this issue, updated yarn, removed their yarn.lock, and re-installed and it worked

  • default discord avatar
    serominelast year

    thanks alot for the reply, let me try this

  • default discord avatar
    notchrlast year

    no prob, let me know

  • default discord avatar
    rilromlast year

    I had this issue intermittently with v2, deleting yarn.lock etc does resolve it but it would come back at least once a day, no idea why.

  • default discord avatar
    notchrlast year

    After updating yarn as well too?

    @127418710519578624
  • default discord avatar
    rilromlast year

    I honestly don’t recall, I have been slowly migrating over to yarn v4 from yarn v1 so there’s a good chance that resolved it, I’m using payload v3 now though so haven’t checked.

  • default discord avatar
    notchrlast year

    niceee

  • default discord avatar
    serominelast year

    I was using yarn v1.4. I updated it to v4 and resolved the issue. Although now I am getting



    14.76 node:internal/modules/cjs/loader:958


    14.76 throw err;


    14.76 ^


    14.76


    14.76 Error: Cannot find module '/root/.yarn/berry/cache/payload-npm-2.24.0-966861b016-10c0.zip/node_modules/payload/bin.js'



    anything you guys have encountered?

  • default discord avatar
    notchrlast year

    weird



    can you remove your node_modules and run yarn again



    or



    there's like a yarn clear cache command

  • default discord avatar
    serominelast year

    I keep getting this error. Will create a new thread if needed. Thanks for the help

    @1049775120559898725

    !

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.