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!
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
thanks alot for the reply, let me try this
no prob, let me know
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.
After updating yarn as well too?
@127418710519578624I 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.
niceee
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?
weird
can you remove your node_modules and run yarn again
or
there's like a yarn clear cache command
I keep getting this error. Will create a new thread if needed. Thanks for the help
@1049775120559898725!
Star
Discord
online
Get dedicated engineering support directly from the Payload team.