Deploy fails with ENOSPC: no space left on device

My nextjs deploy is failing with the following

2021-07-16T07:39:47Z - internal error - Error while invoking lambda "xdn-deploy-lambda": ENOSPC: no space left on device, write
2021-07-16T07:39:47Z - internal error - Error: ENOSPC: no space left on device, write
2021-07-16T07:39:47Z - error - DeployBuild job failed [unexpected]: Error while invoking lambda "xdn-deploy-lambda": ENOSPC: no space left on device, write

When I download my deployment it’s 1.3GB on disk.

Almost 700 MB of that is in the lambda folder.

450 MB in node modules with much of that in geopip-ip lite .dat files

The .next/serverless/pages folder is also quite large at 207.5 MB

How can I reduce that?

Which Modules can be moved to devDependencies?

Here’s my package.json:

{
  "scripts": {
    "layer0:dev": "layer0 dev",
    "layer0:build": "layer0 build",
    "layer0:deploy": "layer0 deploy",
    "dev": "prettier --write public/static/locales/**; sortjson public/static/locales/**; REACT_APP_STAGE=local node server.js;",
    "dev-prod": "prettier --write public/static/locales/**; sortjson public/static/locales/**; REACT_APP_STAGE=prod node server.js",
    "build": "next build",
    "start": "node server.js",
    "analyze": "cross-env ANALYZE=true next build",
    "analyze:server": "cross-env BUNDLE_ANALYZE=server next build",
    "analyze:browser": "cross-env BUNDLE_ANALYZE=browser next build",
    "format": "pretty-quick --staged"
  },
  "name": "frontend-mobileweb",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@artsy/fresnel": "^1.1.0",
    "@fortawesome/fontawesome-svg-core": "^1.2.27",
    "@fortawesome/free-brands-svg-icons": "^5.13.0",
    "@fortawesome/free-regular-svg-icons": "^5.12.1",
    "@fortawesome/free-solid-svg-icons": "^5.12.1",
    "@fortawesome/react-fontawesome": "^0.1.9",
    "@fullcalendar/daygrid": "^5.6.0",
    "@fullcalendar/interaction": "^5.6.0",
    "@fullcalendar/react": "^5.6.0",
    "@next/bundle-analyzer": "^9.4.4",
    "@stripe/react-stripe-js": "^1.0.3",
    "@stripe/stripe-js": "^1.0.2",
    "@mobileweb/mobileweb-react-payment-form": "^1.6.3",
    "@zeit/next-css": "^1.0.1",
    "@zeit/next-sass": "^1.0.1",
    "axios": "^0.19.2",
    "chart.js": "^2.9.3",
    "classnames": "^2.3.1",
    "cleave.js": "^1.5.10",
    "copy-to-clipboard": "^3.3.1",
    "cross-env": "^7.0.2",
    "date-fns": "^2.14.0",
    "express": "^4.17.1",
    "formik": "^2.1.4",
    "geoip-lite": "^1.4.1",
    "html-react-parser": "^0.10.1",
    "immutability-helper": "^3.0.1",
    "json-sort-cli": "^1.18.16",
    "jwt-decode": "^2.2.0",
    "latinize": "^0.4.1",
    "libphonenumber-js": "^1.7.52",
    "moment": "^2.24.0",
    "next": "9.5.5",
    "next-i18next": "^4.2.1",
    "next-images": "^1.3.1",
    "next-redux-wrapper": "^4.0.1",
    "node-sass": "^4.14.1",
    "prop-types": "^15.7.2",
    "q": "^1.5.1",
    "qrcode.react": "^1.0.0",
    "query-string": "^6.11.0",
    "rc-slider": "^9.2.3",
    "react": "^16.12.0",
    "react-chartjs-2": "^2.9.0",
    "react-compound-timer": "^1.2.0",
    "react-content-loader": "^5.0.1",
    "react-countdown": "^2.2.1",
    "react-date-range": "^1.1.3",
    "react-dom": "^16.12.0",
    "react-facebook-login": "^4.1.1",
    "react-google-login": "^5.1.3",
    "react-google-maps": "^9.4.5",
    "react-google-recaptcha": "^2.0.1",
    "react-highlight-words": "^0.16.0",
    "react-id-swiper": "^3.0.0",
    "react-image-gallery": "^1.0.6",
    "react-infinite-calendar": "^2.3.1",
    "react-intl-tel-input": "^7.1.0",
    "react-js-pagination": "^3.0.3",
    "react-mailchimp-form": "^1.0.2",
    "react-parallax": "^3.1.2",
    "react-paypal-button-v2": "^2.6.1",
    "react-perfect-scrollbar": "^1.5.8",
    "react-qr-reader": "^2.2.1",
    "react-redux": "^7.1.3",
    "react-select": "^3.0.8",
    "react-slick": "^0.26.1",
    "react-text-mask": "^5.4.3",
    "react-timeago": "^4.4.0",
    "reactjs-popup": "^1.5.0",
    "recompose": "^0.30.0",
    "redux": "^4.0.5",
    "socket.io-client": "^2.3.0",
    "swiper": "^5.4.5",
    "text-mask-addons": "^3.8.0",
    "typewriter-effect": "^2.13.1",
    "universal-cookie": "^4.0.3",
    "yup": "^0.28.1"
  },
  "devDependencies": {
    "@layer0/cli": "^3.16.1",
    "@layer0/core": "^3.16.1",
    "@layer0/devtools": "^3.16.1",
    "@layer0/next": "^3.16.1",
    "@layer0/prefetch": "^3.16.1",
    "@layer0/react": "^3.16.1",
    "babel-eslint": "^10.1.0",
    "cz-conventional-changelog": "3.3.0",
    "eslint": "^7.21.0",
    "eslint-config-airbnb": "^18.2.1",
    "eslint-config-prettier": "^8.1.0",
    "eslint-plugin-import": "^2.22.1",
    "eslint-plugin-react": "^7.22.0",
    "husky": "^5.1.3",
    "lint-staged": "^10.5.4",
    "prettier": "^2.2.1",
    "pretty-quick": "^3.1.0"
  },
  "husky": {
    "hooks": {
      "pre-commit": "pretty-quick --staged"
    }
  },
  "lint-staged": {
    "/**/*.js": [
      "eslint",
      "pretty-quick - staged",
      "git add"
    ]
  },
  "config": {
    "commitizen": {
      "path": "./node_modules/cz-conventional-changelog"
    }
  }
}