The first time the npm run serve ran, there was no error. After the change file was saved, it was automatically repackaged and an error was reported: FATAL ERROR: Retrieved heap limit Allocation failed – JavaScript heap out of memory, as shown in the following figure:
Problem: Too many resources were referenced, Causing node memory overflow
Solution:
1. Global installnpm install - g increase memory-limit
2. Execute increase-memory-limit
3. Run the project npm run serve
If it appears after running:
“node –max-old-space-size=10240″‘ is not an internal or external command, nor is it an executable program or program file
Search for “%_prog%” in the .bin file in the node_modules directory and replace it all with %_prog%
If no file is found, click the ignored file button
to replace it and run: npm run serve
It will be OK!