'I keep getting builder.rimraf is not a function when i build npm

I am trying to make my svelteapp prodcution ready and therefor running npm run build I have tried with several adapters but i keep getting the same error saying

> Using @sveltejs/adapter-netlify
> builder.rimraf is not a function

The application itself runs fine with npm run dev.

I have searched everywhere. tried the following

  • node version 16.14.0 also tried with older version and the newest 17.5.0
  • Deleting node_modules and ran npm i again
  • deleting package-lock.json
  • tried another adapter like adapter-vercel and adapter-auto that comes with sveltekit


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source