mkdirp causes an out of memory error when making a directory to a Windows drive that doesn’t exist

Reporting a bug

What is the current behavior?

yarn when issued any command stalls forever until it reports

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

Even by setting $ENV:NODE_COMMANDS="--max-old-space-size=4096", yarn will just consume it all and then fail.

If the current behavior is a bug, please provide the steps to reproduce.

This was a fresh install of windows 10, I had recently just completed the build tool installation for NodeJS, and then installed yarn 1.12. I opened up a powershell window, then typed in yarn config list.

What is the expected behavior?

Anything to work

Please mention your node.js, yarn and operating system version.

  • Windows 10 17134.345
  • node v10.12.0 with build tools
  • yarn 1.12 AND 1.10.1

Author: Fantashit

1 thought on “mkdirp causes an out of memory error when making a directory to a Windows drive that doesn’t exist

  1. I think the issue is the following:

    .yarnrc

    # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
    # yarn lockfile v1
    
    
    cache-folder "S:\\yarn-cache"
    lastUpdateCheck 1539138928914
    

    The S: drive on my machine doesn’t exist. This happened when I reinstalled and my letters got mangled, but I ported over all my old dotfiles.

    I think what is happening is that it is trying to do something with the yarn-cache, and doesn’t handle the rejection of a drive not existing, spinning out of control until it explodes.

    Changing the cache-folder to an existing drive resolved the issue.

Comments are closed.