Author Topic: Unable to build in vue  (Read 1500 times)

Walltech

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 2
    • View Profile
Unable to build in vue
« on: January 18, 2021, 09:06:46 am »
  My Vue project can run normally in the development environment after introducing pqgrid, but the project cannot be packaged. After executing "npm run build", you are stuck in the "building for production..." step all the time, and then an error is reported after waiting for a long time. When the pqgrid and related dependencies are not added, the "npm run build" command can be executed normally. The error information is:" FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory".
  I already tried to increase the memory by adding --max_old_space_size=4096 and even tried to change it to 8192, but to no avail. I am using a Windows with 8 GB of RAM so I'm not sure why this is happening.This is the code I run for npm run build:"vue-cli-service build --max_old_space_size=4096".

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Unable to build in vue
« Reply #1 on: January 18, 2021, 11:02:10 am »
Please use this command on terminal to increase the memory for current terminal session

Code: [Select]
set NODE_OPTIONS=--max_old_space_size=4096

or this to save it permanently.

Code: [Select]
setx NODE_OPTIONS --max_old_space_size=4096