Next.js v13 Installation Fails on Repl with Unknown System Error -122

Problem description:
Unable to install Next.js v13.

Expected behavior:
Upon running the yarn command, Next.js v13 should be successfully upgraded. This process works correctly on my local machine.

Actual behavior:
Installation fails with the following error message:

yarn install v1.22.19
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
error An unexpected error occurred: "Unknown system error -122: Unknown system error -122, open '/home/runner/.cache/yarn/v6/npm-typed-array-length-1.0.4-89d83785e5c4098bec72e08b319651f0eac9c1bb-integrity/node_modules/typed-array-length/.yarn-metadata.json'".
info If you think this is a bug, please open a bug report with the information provided in "/home/runner/WovenPDF/yarn-error.log".
info Visit for documentation about this command.

Steps to reproduce:
For this template:

  1. Upgrade to the latest nextjs (next: “13.3.1”) inside of the package.json
  2. remove node_modules rm -rf node_modules
  3. remove yarn lock rm yarn.lock
  4. clear cache yarn cache clean
  5. install packages yarn install

Bug appears at this link:

  1. Failed to extract tar content of undefined
yarn install v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
error Extracting tar content of undefined failed, the file appears to be corrupt: "Unknown system error -122: Unknown system error -122, write"
... other similar errors

Restarting, uninstalling node_modules, and clearing cache seem to resolve the issue.

Not applicable, as the issue occurs within the repl environment, including when using SSH.

1 Like

Not directly relevant, but in a later repl, I had the same issue and it seems to have fixed itself when I deleted (from the default dir) .next .config .svd

I also had to restart the repl by running kill 1

Update: For some reason yarn is erroring out, even if you update the registry yarn config set registry so I don’t know what’s going on there.

For reference, my versions are…
npm: 8.15.0
node: 16.17.0
yarn: 1.22.17 (which as far as I’m aware is the latest)

Upon further investigation, it appears that the Node.js template has access to Node 18, which is puzzling since it fails to run in my regular Repl. Nonetheless, I was able to resolve my issue by forking the template, transferring my Next.js project, and voila, it worked flawlessly.

System Error -122 means you’re out of disk space. Try deleting node_modules and .next and then install packages + run the Repl again.

1 Like

I have this problem as well with yarn install. I deleted node_modules and I am using 1% disk space in the repl.

error Extracting tar content of undefined failed, the file appears to be corrupt: "Unknown system error -122: Unknown system error -122, write"```

Run kill 1 in the shell and refresh the page

I did see the disk quota error, but it wasn’t relevant. I think it’s a bug.

-122 system errors always mean that you’re out of disk space. What isn’t relevant?

I have tried this over the last couple hours and no luck. The git codebase I am using is not big it is at GitHub - mayooear/gpt4-pdf-chatbot-langchain: GPT4 & LangChain Chatbot for large PDF docs

Can you send me the link to your Repl so I can take a look?

its private tho

What happens when you fork the Repl and run yarn in the shell?

1 Like
error Extracting tar content of undefined failed, the file appears to be corrupt: "Unknown system error -122: Unknown system error -122, write"```

Can you invite @ReplitIronclad to the Repl so I can take a look and do some debugging?


Fixed! Your Repl works now!

I used npm to install packages. If you decide to use yarn, please delete package-lock.json.


I am not actually out of disk space, it just says that I am. Meaning, I still have plenty of available space in the repl and I still have space overall. So It’s not relevant because it’s saying I’m out of disk space when I’m actually not. Perhaps it is interpreting the inability to write a file as out of disk space?

There are some automatic things where if it detects what you will be writing is to much, it kills the process, even if you still have some left, so it is never shown in the UI

that’s possible. If that’s the case, then it would be super helpful to have some kind of feedback. I’m assuming in this case that it’s first writing the new files before deleting the old ones or something. Because after install it will be ~50% of the storage. For those that may be having issues, try running du -h -c . from teh default directory. I found this helped me figure out which cached files were taking up so much space.

By the way, when do you all suspect you’ll support more than 1GB of storage? It seems to limit me quite often. (and I’m happy to pay for more :smile: )

@IroncladDev I invited you to my repl. The behavior is that yarn install results in the following

This similarly happens with npm, here’re the relevant error outputs:

0 verbose cli /nix/store/c9n6r58axvfjrikw5a9giall7k5v1pdm-nodejs-16.17.0/bin/node /nix/store/c9n6r58axvfjrikw5a9giall7k5v1pdm-nodejs-16.17.0/bin/npm
1 info using npm@8.15.0
2 info using node@v16.17.0
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 2ms
5 timing config:load:file:/nix/store/c9n6r58axvfjrikw5a9giall7k5v1pdm-nodejs-16.17.0/lib/node_modules/npm/npmrc Completed in 1ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 3ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:/home/runner/WovenPDF/.npmrc Completed in 0ms
10 timing config:load:project Completed in 5ms
11 timing config:load:file:/home/runner/.npmrc Completed in 0ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:/home/runner/WovenPDF/.config/npm/node_global/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 1ms
16 timing config:load:credentials Completed in 2ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 18ms
19 timing npm:load:configload Completed in 18ms
20 timing npm:load:mkdirpcache Completed in 5ms
21 timing npm:load:mkdirplogs Completed in 0ms
22 verbose title npm install
23 verbose argv "install"
24 timing npm:load:setTitle Completed in 2ms
25 timing config:load:flatten Completed in 4ms
26 timing npm:load:display Completed in 7ms
27 verbose logfile logs-max:10 dir:/home/runner/.npm/_logs
28 verbose logfile /home/runner/.npm/_logs/2023-04-26T22_15_44_889Z-debug-0.log
29 timing npm:load:logFile Completed in 8ms
30 timing npm:load:timers Completed in 0ms
31 timing npm:load:configScope Completed in 0ms
32 timing npm:load Completed in 44ms
33 timing arborist:ctor Completed in 1ms
34 silly logfile done cleaning log files
35 timing arborist:ctor Completed in 0ms
36 timing idealTree:init Completed in 78ms
37 timing idealTree:userRequests Completed in 1ms
38 silly idealTree buildDeps
39 silly fetch manifest @chakra-ui/icons@2.0.19
40 http fetch GET 200 268ms (cache updated)
41 http fetch GET 200 292ms (cache miss)
42 silly fetch manifest @chakra-ui/system@>=2.0.0
43 http fetch GET 200 74ms (cache miss)
44 silly fetch manifest @emotion/react@11.10.6
45 http fetch GET 200 67ms (cache miss)
46 silly fetch manifest react@18.2.0
47 http fetch GET 200 56ms (cache updated)
48 silly fetch manifest @emotion/styled@11.10.6
49 http fetch GET 200 61ms (cache miss)
50 silly fetch manifest @chakra-ui/react@2.6.0
51 http fetch GET 200 92ms (cache miss)
52 silly fetch manifest framer-motion@10.12.4
53 http fetch GET 200 60ms (cache miss)
54 silly fetch manifest react-dom@18.2.0
55 http fetch GET 200 60ms (cache miss)
56 silly fetch manifest @dqbd/tiktoken@1.0.6
57 http fetch GET 200 77ms (cache miss)
58 silly fetch manifest @fortawesome/fontawesome-svg-core@6.4.0
59 http fetch GET 200 67ms (cache miss)
60 silly fetch manifest @fortawesome/free-solid-svg-icons@6.4.0
61 http fetch GET 200 129ms (cache miss)
62 silly fetch manifest @fortawesome/react-fontawesome@0.2.0
63 http fetch GET 200 53ms (cache miss)
64 silly fetch manifest axios@1.3.6
65 http fetch GET 200 60ms (cache updated)
66 silly fetch manifest babel-plugin-styled-components@2.1.1
67 http fetch GET 200 56ms (cache miss)
68 silly fetch manifest styled-components@5.3.10
69 http fetch GET 200 94ms (cache miss)
70 silly fetch manifest react-is@>= 16.8.0
71 http fetch GET 200 96ms (cache updated)
72 silly fetch manifest fetch-retry@5.0.4
73 http fetch GET 200 42ms (cache miss)
74 silly fetch manifest indent-string@5.0.0
75 http fetch GET 200 45ms (cache updated)
76 silly fetch manifest isomorphic-fetch@3.0.0
77 http fetch GET 200 52ms (cache updated)
78 silly fetch manifest jsonrepair@3.0.3
79 http fetch GET 200 92ms (cache miss)
80 silly fetch manifest lodash@4.17.21
81 http fetch GET 200 54ms (cache updated)
82 silly fetch manifest mixpanel-browser@2.46.0
83 http fetch GET 200 29ms (cache miss)
84 silly fetch manifest next@12.2.0
85 http fetch GET 200 154ms (cache miss)
86 silly fetch manifest fibers@>= 3.1.0
87 http fetch GET 200 40ms (cache miss)
88 silly fetch manifest node-sass@^6.0.0 || ^7.0.0
89 http fetch GET 200 31ms (cache miss)
90 silly fetch manifest sass@^1.3.0
91 http fetch GET 200 35ms (cache miss)
92 silly fetch manifest openai@3.2.1
93 http fetch GET 200 39ms (cache miss)
94 silly fetch manifest p-limit@4.0.0
95 http fetch GET 200 60ms (cache updated)
96 silly fetch manifest p-queue@7.3.4
97 http fetch GET 200 48ms (cache updated)
98 silly fetch manifest react-intl@6.4.1
99 http fetch GET 200 38ms (cache miss)
100 silly fetch manifest typescript@5.0.4
101 http fetch GET 200 95ms (cache updated)
102 silly fetch manifest react-query@3.39.3
103 http fetch GET 200 132ms (cache miss)
104 silly fetch manifest tailwindcss@3.3.2
105 http fetch GET 200 65ms (cache miss)
106 silly fetch manifest tinycolor2@1.6.0
107 http fetch GET 200 65ms (cache updated)
108 silly fetch manifest uuid@9.0.0
109 http fetch GET 200 87ms (cache updated)
110 silly fetch manifest @types/node@18.0.1
111 notice
111 notice New major version of npm available! 8.15.0 -> 9.6.5
111 notice Changelog:
111 notice Run npm install -g npm@9.6.5 to update!
111 notice
112 verbose stack Error: Unknown system error -122: Unknown system error -122, write
113 verbose cwd /home/runner/WovenPDF
114 verbose Linux 5.15.0-1032-gcp
115 verbose node v16.17.0
116 verbose npm  v8.15.0
117 error code Unknown system error -122
118 error syscall write
119 error errno -122
120 error Unknown system error -122: Unknown system error -122, write
121 verbose exit -122
122 timing npm Completed in 3451ms
123 verbose unfinished npm timer command:install 1682547345009
124 verbose unfinished npm timer reify 1682547345012
125 verbose unfinished npm timer reify:loadTrees 1682547345030
126 verbose unfinished npm timer idealTree 1682547345031
127 verbose unfinished npm timer idealTree:buildDeps 1682547345110
128 verbose unfinished npm timer idealTree:#root 1682547345111
129 verbose code -122
130 error A complete log of this run can be found in:
130 error     /home/runner/.npm/_logs/2023-04-26T22_15_44_889Z-debug-0.log

By the way, this is likely related to my use of a custom node version:


  customPkgs = import (builtins.fetchTarball {
    url = "";
  }) {};

  customNodejs = customPkgs.nodejs-16_x.overrideAttrs (oldAttrs: rec {
    version = "16.17.0";
    src = customPkgs.fetchurl {
      url = "${version}/node-v${version}.tar.xz";
      sha256 = "0iang6lqx006ki45wxd9zpscbh59bib67j8vja2nji2yd22w4a0x";
{ pkgs ? customPkgs }: {
  deps = [

When I tried to update the shell it first errored with Disk quota exceeded but then after deleting .next with rm -rf .next it worked.du -h -c . seems to have outputted a more reliable metric for the size of the files / directories.

I am going to leave it as it is for you to mess around with (that’s a deprecated repl so do as you please), but in a previous attempt to fix it I had reversed back to standard node, and npm started to work but yarn did not.

Finally, I’m still unclear why pkgs.nodejs-18_x is not considered valid because it is considered valid in the nodejs replit template.

edit: p.s. when I went back into that repl today yarn worked, so that suggests that there was some kind of cron or something that fixed it overnight (i.e. yarn worked with standard node when before it has only worked for npm and not yarn)