Symfony npm run build ENOMEM error on prod

I have a Symfony 5 project that I would like to deploy. When I run npm run build locally, it works, but on my server in production, it gives me an error:

enter image description here
enter image description here
enter image description here

The versions of node and npm are the same locally and on the server:

node version: v14.15.0
npm version: v6.14.9

My package.json:

{
    "devDependencies": {
        "@symfony/webpack-encore": "^0.31.0",
        "core-js": "^3.8.0",
        "regenerator-runtime": "^0.13.7",
        "sass-loader": "^9.0.3",
        "webpack-notifier": "^1.11.0"
    },
    "license": "UNLICENSED",
    "private": true,
    "scripts": {
        "dev-server": "encore dev-server",
        "dev": "encore dev",
        "watch": "encore dev --watch",
        "build": "encore production --progress",
        "heroku-postbuild": "node_modules/.bin/encore production"
    },
    "dependencies": {
        "@fortawesome/fontawesome-free": "^5.15.0",
        "@fullcalendar/core": "^4.4.2",
        "@fullcalendar/daygrid": "^4.4.2",
        "@fullcalendar/interaction": "^4.4.2",
        "@fullcalendar/list": "^4.4.2",
        "@fullcalendar/timegrid": "^4.4.2",
        "@ttskch/select2-bootstrap4-theme": "^1.4.0",
        "ajaxchimp": "^1.3.0",
        "animate.css": "^4.1.1",
        "axios": "^0.19.2",
        "bootstrap": "^4.5.2",
        "bootstrap-datepicker": "^1.9.0",
        "bootstrap-input-spinner": "^1.16.5",
        "bootswatch": "^4.5.2",
        "bs-custom-file-input": "^1.3.4",
        "chart.js": "^2.9.3",
        "counterup": "^1.0.2",
        "dotenv": "^8.2.0",
        "flat-icons": "^1.0.0",
        "flatpickr": "^4.6.6",
        "font-awesome": "^4.7.0",
        "foundation-emails": "^2.3.1",
        "gasparesganga-jquery-loading-overlay": "^2.1.7",
        "gmaps": "^0.4.25",
        "isotope-layout": "^3.0.6",
        "jodit": "^3.4.27",
        "jquery": "^3.5.1",
        "jquery-form": "^4.3.0",
        "jquery-mousewheel": "^3.1.13",
        "jquery-nice-select": "^1.1.0",
        "jquery-parallax": "^1.0.1",
        "jquery-slimscroll": "^1.3.8",
        "jquery-ui-sortable": "^1.0.0",
        "jquery.stellar": "^0.6.2",
        "linearicons": "^1.0.2",
        "magnific-popup": "^1.1.0",
        "moment": "^2.29.0",
        "node-sass": "^4.14.0",
        "owl.carousel": "^2.3.4",
        "perfect-scrollbar": "^1.5.0",
        "places.js": "^1.19.0",
        "popper.js": "^1.16.1",
        "select2": "^4.0.13",
        "sweetalert2": "^9.17.2",
        "symfony-collection": "^2.1",
        "toastr": "^2.1.4",
        "webpack-jquery-ui": "^2.0.1"
    },
    "name": "SylviaTest"
}

I tested to remove node_modules folder, clean the npm cache, and reinstall node modules, rebuild node-sass, update the packages, but always the same error..

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *