website template errors on npm install

default discord avatar
hades200082
last month
8

I get the following errors after getting the template with

npx create-payload-app my-project -t website --use-npm

and then running

npm install

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @payloadcms/plugin-form-builder@1.0.15
npm ERR! Found: payload@2.0.13
npm ERR! node_modules/payload
npm ERR!   payload@"^2.0.0" from the root project
npm ERR!   peer payload@"^2.0.0" from @payloadcms/bundler-webpack@1.0.4
npm ERR!   node_modules/@payloadcms/bundler-webpack
npm ERR!     @payloadcms/bundler-webpack@"^1.0.0" from the root project
npm ERR!   5 more (@payloadcms/db-mongodb, @payloadcms/plugin-cloud, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer payload@"^0.18.5 || ^1.0.0" from @payloadcms/plugin-form-builder@1.0.15
npm ERR! node_modules/@payloadcms/plugin-form-builder
npm ERR!   @payloadcms/plugin-form-builder@"^1.0.13" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: payload@1.15.8
npm ERR! node_modules/payload
npm ERR!   peer payload@"^0.18.5 || ^1.0.0" from @payloadcms/plugin-form-builder@1.0.15
npm ERR!   node_modules/@payloadcms/plugin-form-builder
npm ERR!     @payloadcms/plugin-form-builder@"^1.0.13" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
  • discord user avatar
    denolfe
    Payload Team
    4 weeks ago

    Looks like we need to update that package's peer deps to include 2.0.



    In the meantime, if you still want to use npm as your package manager, you'll need to make an npmrc with legacy peer deps set to true.

  • default discord avatar
    manny_49461
    4 weeks ago

    @denolfe So would form builder work on 2.0 if using yarn?

  • discord user avatar
    denolfe
    Payload Team
    4 weeks ago

    A beta version has been released with proper peer dependencies. You can give that a try.

  • default discord avatar
    manny_49461
    4 weeks ago

    Oh awesome, sorry but where would I find that? Is it this?

    https://github.com/payloadcms/plugin-form-builder/pull/63
  • discord user avatar
    denolfe
    Payload Team
    4 weeks ago

    We migrated it into our monorepo actually.



    Should be able to do just install @payloadcms/plugin-form-builder@beta

  • default discord avatar
    manny_49461
    4 weeks ago

    Ahh gotcha, thank you Elliot!

  • discord user avatar
    denolfe
    Payload Team
    4 weeks ago

    Still need to do some cleanup and archive that old repo. Was waiting for some people to try out the beta before doing so.

  • default discord avatar
    manny_49461
    4 weeks ago

    I'll definitely be trying it out. Need to launch a client site before December, would love to include form builder 😬



    It seems to be working well, I was able to fix the issues I was having by adding transpilePackages: ["@payloadcms/plugin-form-builder"] to next.config.js

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.