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 https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Steps to reproduce:
For this template: https://replit.com/@ErikoXDev/Nextjs-TailwindCSS?v=1
- Upgrade to the latest nextjs (next: “13.3.1”) inside of the package.json
- remove node_modules
rm -rf node_modules
- remove yarn lock
rm yarn.lock
- clear cache
yarn cache clean
- install packages
yarn install
Bug appears at this link:
- Failed to extract tar content of undefined
yarn install v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
error https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.3.1.tgz: 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.
Browser/OS/Device:
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 https://registry.npmjs.org/
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 https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.16.tgz: 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?
What happens when you fork the Repl and run yarn
in the shell?
1 Like
error https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz: 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?
2 Likes
Fixed! Your Repl works now!
I used npm
to install packages. If you decide to use yarn, please delete package-lock.json.
2 Likes
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
)
@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 https://registry.npmjs.org/npm 268ms (cache updated)
41 http fetch GET 200 https://registry.npmjs.org/@chakra-ui%2ficons 292ms (cache miss)
42 silly fetch manifest @chakra-ui/system@>=2.0.0
43 http fetch GET 200 https://registry.npmjs.org/@chakra-ui%2fsystem 74ms (cache miss)
44 silly fetch manifest @emotion/react@11.10.6
45 http fetch GET 200 https://registry.npmjs.org/@emotion%2freact 67ms (cache miss)
46 silly fetch manifest react@18.2.0
47 http fetch GET 200 https://registry.npmjs.org/react 56ms (cache updated)
48 silly fetch manifest @emotion/styled@11.10.6
49 http fetch GET 200 https://registry.npmjs.org/@emotion%2fstyled 61ms (cache miss)
50 silly fetch manifest @chakra-ui/react@2.6.0
51 http fetch GET 200 https://registry.npmjs.org/@chakra-ui%2freact 92ms (cache miss)
52 silly fetch manifest framer-motion@10.12.4
53 http fetch GET 200 https://registry.npmjs.org/framer-motion 60ms (cache miss)
54 silly fetch manifest react-dom@18.2.0
55 http fetch GET 200 https://registry.npmjs.org/react-dom 60ms (cache miss)
56 silly fetch manifest @dqbd/tiktoken@1.0.6
57 http fetch GET 200 https://registry.npmjs.org/@dqbd%2ftiktoken 77ms (cache miss)
58 silly fetch manifest @fortawesome/fontawesome-svg-core@6.4.0
59 http fetch GET 200 https://registry.npmjs.org/@fortawesome%2ffontawesome-svg-core 67ms (cache miss)
60 silly fetch manifest @fortawesome/free-solid-svg-icons@6.4.0
61 http fetch GET 200 https://registry.npmjs.org/@fortawesome%2ffree-solid-svg-icons 129ms (cache miss)
62 silly fetch manifest @fortawesome/react-fontawesome@0.2.0
63 http fetch GET 200 https://registry.npmjs.org/@fortawesome%2freact-fontawesome 53ms (cache miss)
64 silly fetch manifest axios@1.3.6
65 http fetch GET 200 https://registry.npmjs.org/axios 60ms (cache updated)
66 silly fetch manifest babel-plugin-styled-components@2.1.1
67 http fetch GET 200 https://registry.npmjs.org/babel-plugin-styled-components 56ms (cache miss)
68 silly fetch manifest styled-components@5.3.10
69 http fetch GET 200 https://registry.npmjs.org/styled-components 94ms (cache miss)
70 silly fetch manifest react-is@>= 16.8.0
71 http fetch GET 200 https://registry.npmjs.org/react-is 96ms (cache updated)
72 silly fetch manifest fetch-retry@5.0.4
73 http fetch GET 200 https://registry.npmjs.org/fetch-retry 42ms (cache miss)
74 silly fetch manifest indent-string@5.0.0
75 http fetch GET 200 https://registry.npmjs.org/indent-string 45ms (cache updated)
76 silly fetch manifest isomorphic-fetch@3.0.0
77 http fetch GET 200 https://registry.npmjs.org/isomorphic-fetch 52ms (cache updated)
78 silly fetch manifest jsonrepair@3.0.3
79 http fetch GET 200 https://registry.npmjs.org/jsonrepair 92ms (cache miss)
80 silly fetch manifest lodash@4.17.21
81 http fetch GET 200 https://registry.npmjs.org/lodash 54ms (cache updated)
82 silly fetch manifest mixpanel-browser@2.46.0
83 http fetch GET 200 https://registry.npmjs.org/mixpanel-browser 29ms (cache miss)
84 silly fetch manifest next@12.2.0
85 http fetch GET 200 https://registry.npmjs.org/next 154ms (cache miss)
86 silly fetch manifest fibers@>= 3.1.0
87 http fetch GET 200 https://registry.npmjs.org/fibers 40ms (cache miss)
88 silly fetch manifest node-sass@^6.0.0 || ^7.0.0
89 http fetch GET 200 https://registry.npmjs.org/node-sass 31ms (cache miss)
90 silly fetch manifest sass@^1.3.0
91 http fetch GET 200 https://registry.npmjs.org/sass 35ms (cache miss)
92 silly fetch manifest openai@3.2.1
93 http fetch GET 200 https://registry.npmjs.org/openai 39ms (cache miss)
94 silly fetch manifest p-limit@4.0.0
95 http fetch GET 200 https://registry.npmjs.org/p-limit 60ms (cache updated)
96 silly fetch manifest p-queue@7.3.4
97 http fetch GET 200 https://registry.npmjs.org/p-queue 48ms (cache updated)
98 silly fetch manifest react-intl@6.4.1
99 http fetch GET 200 https://registry.npmjs.org/react-intl 38ms (cache miss)
100 silly fetch manifest typescript@5.0.4
101 http fetch GET 200 https://registry.npmjs.org/typescript 95ms (cache updated)
102 silly fetch manifest react-query@3.39.3
103 http fetch GET 200 https://registry.npmjs.org/react-query 132ms (cache miss)
104 silly fetch manifest tailwindcss@3.3.2
105 http fetch GET 200 https://registry.npmjs.org/tailwindcss 65ms (cache miss)
106 silly fetch manifest tinycolor2@1.6.0
107 http fetch GET 200 https://registry.npmjs.org/tinycolor2 65ms (cache updated)
108 silly fetch manifest uuid@9.0.0
109 http fetch GET 200 https://registry.npmjs.org/uuid 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: https://github.com/npm/cli/releases/tag/v9.6.5
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:
replit.nix
let
customPkgs = import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/c2c0373ae7abf25b7d69b2df05d3ef8014459ea3.tar.gz";
}) {};
customNodejs = customPkgs.nodejs-16_x.overrideAttrs (oldAttrs: rec {
version = "16.17.0";
src = customPkgs.fetchurl {
url = "https://nodejs.org/dist/v${version}/node-v${version}.tar.xz";
sha256 = "0iang6lqx006ki45wxd9zpscbh59bib67j8vja2nji2yd22w4a0x";
};
});
in
{ pkgs ? customPkgs }: {
deps = [
customNodejs
pkgs.nodePackages.typescript-language-server
pkgs.replitPackages.jest
];
}
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)