Heap Memory Exceeded Limit using Yarn to install
Describe the bug Got into memory exceeded limit error when trying to install the plugin using yarn
To Reproduce Steps to reproduce the behavior:
- Go to terminal - install
- Run
yarn add purgecss-webpack-plugin - See error
Note: have tried the following:
- export NODE_OPTIONS= --max_old_space_size=16000
Expected behavior should install successfully
Screenshots
❯ yarn add purgecss-webpack-plugin
yarn add v1.22.10
[1/5] 🔍 Validating package.json...
[2/5] 🔍 Resolving packages...
[3/5] 🚚 Fetching packages...
[4/5] 🔗 Linking dependencies...
warning " > [email protected]" has incorrect peer dependency "webpack@^3.1.0".
warning " > [email protected]" has incorrect peer dependency "webpack@1 || 2 || 3".
<--- Last few GCs --->
[1585:0x1046ab000] 934298 ms: Scavenge (reduce) 15963.4 (16020.1) -> 15963.0 (16020.6) MB, 27.0 / 0.0 ms (average mu = 0.278, current mu = 0.207) allocation failure
[1585:0x1046ab000] 934322 ms: Scavenge (reduce) 15963.7 (16017.6) -> 15963.3 (16018.9) MB, 21.4 / 0.0 ms (average mu = 0.278, current mu = 0.207) allocation failure
[1585:0x1046ab000] 934345 ms: Scavenge (reduce) 15964.0 (16020.9) -> 15963.7 (16021.4) MB, 20.4 / 0.0 ms (average mu = 0.278, current mu = 0.207) allocation failure
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0x1012d96a5 node::Abort() (.cold.1)
2: v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool)
3: 0x100395df5 v8::internal::Heap::FatalProcessOutOfMemory(char const*)
4: 0x10039789a v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector)
Environment (please complete the following information):
- Node version - 14.15.5
- OS: 10.15.7
- Package - purgecss
- yarn version - 1.9.4
This is more likely an issue with yarn itself. Does it happen only when trying to add this plugin? If you try to install other webpack plugins, you don't see the same result?
If the issue is only with PurgeCSS plugin, could you provide a repository to reproduce this issue?
@Ffloriel thanks for the quick response! It happened even when you installed it with npm. And yes, it only happened when trying to add this.
This is my very basic repo https://github.com/teekenl/test-purge-css, so if you pulled down and run yarn install before trying to run yarn add purgecss-webpack-plugin you will get the error.
Hey @teekenl - did you ever find the solution?
cc @Ffloriel
https://github.com/yarnpkg/yarn/issues/6511
Unsure if it's because of a new version of Yarn but the issue seems to not happen anymore in https://github.com/teekenl/test-purge-css