42

I have nodejs and npm installed I tried running the command

npm install -g create-react-app

but it halts at the error below

freduah@freduah:~$ npm install -g create-react-app
npm WARN registry Unexpected warning for http://registry.npmjs.org/: Miscellaneous Warning EAI_AGAIN: request to http://registry.npmjs.org/create-react-app failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org
npm WARN registry Using stale data from http://registry.npmjs.org/ due to a request error during revalidation.
npm ERR! code FETCH_ERROR
npm ERR! errno FETCH_ERROR
npm ERR! invalid json response body at http://registry.npmjs.org/ansi-escapes reason: Unexpected end of JSON input

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/freduah/.npm/_logs/2020-10-31T19_11_20_727Z-debug.log
freduah@freduah:~$ 

Below Is The Full Error Log Content

freduah@freduah:~/Downloads$ cat /home/freduah/.npm/_logs/2020-10-31T19_11_20_727Z-debug.log
0 verbose cli [
0 verbose cli   '/usr/bin/node',
0 verbose cli   '/usr/bin/npm',
0 verbose cli   'install',
0 verbose cli   '-g',
0 verbose cli   'create-react-app'
0 verbose cli ]
1 info using npm@7.0.3
2 info using node@v12.19.0
3 timing config:load:defaults Completed in 2ms
4 timing config:load:file:/usr/share/npm/npmrc Completed in 3ms
5 timing config:load:builtin Completed in 3ms
6 timing config:load:cli Completed in 4ms
7 timing config:load:env Completed in 0ms
8 timing config:load:project Completed in 1ms
9 timing config:load:file:/home/freduah/.npmrc Completed in 1ms
10 timing config:load:user Completed in 1ms
11 timing config:load:file:/etc/npmrc Completed in 0ms
12 timing config:load:global Completed in 0ms
13 timing config:load:cafile Completed in 0ms
14 timing config:load:validate Completed in 2ms
15 timing config:load:setUserAgent Completed in 1ms
16 timing config:load:setEnvs Completed in 1ms
17 timing config:load Completed in 15ms
18 verbose npm-session 3fe07c2ad8478ec0
19 timing npm:load Completed in 27ms
20 timing arborist:ctor Completed in 1ms
21 timing idealTree:init Completed in 3ms
22 timing idealTree:userRequests Completed in 8ms
23 silly idealTree buildDeps
24 silly fetch manifest create-react-app@*
25 warn registry Unexpected warning for http://registry.npmjs.org/: Miscellaneous Warning EAI_AGAIN: request to http://registry.npmjs.org/create-react-app failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org
26 warn registry Using stale data from http://registry.npmjs.org/ due to a request error during revalidation.
27 http fetch GET 200 http://registry.npmjs.org/create-react-app 10087ms (from cache)
28 silly placeDep ROOT create-react-app@4.0.0 OK for:  want: *
29 silly fetch manifest chalk@4.1.0
30 silly fetch manifest commander@4.1.1
31 silly fetch manifest cross-spawn@7.0.3
32 silly fetch manifest envinfo@7.7.3
33 silly fetch manifest fs-extra@9.0.1
34 silly fetch manifest hyperquest@2.1.3
35 silly fetch manifest inquirer@7.3.3
36 silly fetch manifest semver@7.3.2
37 silly fetch manifest tar-pack@3.4.1
38 silly fetch manifest tmp@0.2.1
39 silly fetch manifest validate-npm-package-name@3.0.0
40 http fetch GET 304 http://registry.npmjs.org/envinfo 23286ms (from cache)
41 http fetch GET 304 http://registry.npmjs.org/cross-spawn 23292ms (from cache)
42 http fetch GET 304 http://registry.npmjs.org/fs-extra 23665ms (from cache)
43 http fetch GET 304 http://registry.npmjs.org/hyperquest 24552ms (from cache)
44 http fetch GET 304 http://registry.npmjs.org/semver 28953ms (from cache)
45 http fetch GET 304 http://registry.npmjs.org/inquirer 28960ms (from cache)
46 http fetch GET 304 http://registry.npmjs.org/tar-pack 29245ms (from cache)
47 http fetch GET 304 http://registry.npmjs.org/tmp 29303ms (from cache)
48 http fetch GET 304 http://registry.npmjs.org/validate-npm-package-name 30877ms (from cache)
49 http fetch GET 304 http://registry.npmjs.org/chalk 36204ms attempt #2 (from cache)
50 http fetch GET 304 http://registry.npmjs.org/commander 36204ms attempt #2 (from cache)
51 timing idealTree:#root Completed in 46313ms
52 silly placeDep node_modules/create-react-app chalk@4.1.0 OK for: create-react-app@4.0.0 want: 4.1.0
53 silly placeDep node_modules/create-react-app commander@4.1.1 OK for: create-react-app@4.0.0 want: 4.1.1
54 silly placeDep node_modules/create-react-app cross-spawn@7.0.3 OK for: create-react-app@4.0.0 want: 7.0.3
55 silly placeDep node_modules/create-react-app envinfo@7.7.3 OK for: create-react-app@4.0.0 want: 7.7.3
56 silly placeDep node_modules/create-react-app fs-extra@9.0.1 OK for: create-react-app@4.0.0 want: 9.0.1
57 silly placeDep node_modules/create-react-app hyperquest@2.1.3 OK for: create-react-app@4.0.0 want: 2.1.3
58 silly placeDep node_modules/create-react-app inquirer@7.3.3 OK for: create-react-app@4.0.0 want: 7.3.3
59 silly placeDep node_modules/create-react-app semver@7.3.2 OK for: create-react-app@4.0.0 want: 7.3.2
60 silly placeDep node_modules/create-react-app tar-pack@3.4.1 OK for: create-react-app@4.0.0 want: 3.4.1
61 silly placeDep node_modules/create-react-app tmp@0.2.1 OK for: create-react-app@4.0.0 want: 0.2.1
62 silly placeDep node_modules/create-react-app validate-npm-package-name@3.0.0 OK for: create-react-app@4.0.0 want: 3.0.0
63 silly fetch manifest ansi-styles@^4.1.0
64 silly fetch manifest supports-color@^7.1.0
65 silly fetch manifest path-key@^3.1.0
66 silly fetch manifest shebang-command@^2.0.0
67 silly fetch manifest which@^2.0.1
68 silly fetch manifest at-least-node@^1.0.0
69 silly fetch manifest graceful-fs@^4.2.0
70 silly fetch manifest jsonfile@^6.0.1
71 silly fetch manifest universalify@^1.0.0
72 silly fetch manifest buffer-from@^0.1.1
73 silly fetch manifest duplexer2@~0.0.2
74 silly fetch manifest through2@~0.6.3
75 silly fetch manifest ansi-escapes@^4.2.1
76 silly fetch manifest cli-cursor@^3.1.0
77 silly fetch manifest cli-width@^3.0.0
78 silly fetch manifest external-editor@^3.0.3
79 silly fetch manifest figures@^3.0.0
80 silly fetch manifest lodash@^4.17.19
81 silly fetch manifest mute-stream@0.0.8
82 silly fetch manifest run-async@^2.4.0
83 silly fetch manifest rxjs@^6.6.0
84 silly fetch manifest string-width@^4.1.0
85 silly fetch manifest strip-ansi@^6.0.0
86 silly fetch manifest through@^2.3.6
87 silly fetch manifest debug@^2.2.0
88 silly fetch manifest fstream@^1.0.10
89 silly fetch manifest fstream-ignore@^1.0.5
90 silly fetch manifest once@^1.3.3
91 silly fetch manifest readable-stream@^2.1.4
92 silly fetch manifest rimraf@^2.5.1
93 silly fetch manifest tar@^2.2.1
94 silly fetch manifest uid-number@^0.0.6
95 silly fetch manifest rimraf@^3.0.0
96 silly fetch manifest builtins@^1.0.3
97 http fetch GET 200 http://registry.npmjs.org/jsonfile 240ms (from cache)
98 http fetch GET 304 http://registry.npmjs.org/ansi-styles 1807ms (from cache)
99 http fetch GET 304 http://registry.npmjs.org/supports-color 1806ms (from cache)
100 http fetch GET 304 http://registry.npmjs.org/which 1866ms (from cache)
101 http fetch GET 304 http://registry.npmjs.org/path-key 1893ms (from cache)
102 http fetch GET 304 http://registry.npmjs.org/at-least-node 1933ms (from cache)
103 http fetch GET 304 http://registry.npmjs.org/graceful-fs 1974ms (from cache)
104 http fetch GET 304 http://registry.npmjs.org/cli-cursor 2773ms (from cache)
105 http fetch GET 304 http://registry.npmjs.org/cli-width 2804ms (from cache)
106 http fetch GET 304 http://registry.npmjs.org/external-editor 2929ms (from cache)
107 http fetch GET 304 http://registry.npmjs.org/mute-stream 2956ms (from cache)
108 http fetch GET 304 http://registry.npmjs.org/lodash 2960ms (from cache)
109 http fetch GET 304 http://registry.npmjs.org/figures 3064ms (from cache)
110 http fetch GET 304 http://registry.npmjs.org/run-async 3500ms (from cache)
111 http fetch GET 304 http://registry.npmjs.org/rxjs 3522ms (from cache)
112 http fetch GET 304 http://registry.npmjs.org/string-width 3555ms (from cache)
113 http fetch GET 304 http://registry.npmjs.org/universalify 3677ms (from cache)
114 http fetch GET 304 http://registry.npmjs.org/buffer-from 3687ms (from cache)
115 http fetch GET 304 http://registry.npmjs.org/strip-ansi 3660ms (from cache)
116 http fetch GET 304 http://registry.npmjs.org/through 3681ms (from cache)
117 http fetch GET 304 http://registry.npmjs.org/debug 3784ms (from cache)
118 http fetch GET 304 http://registry.npmjs.org/fstream 4015ms (from cache)
119 http fetch GET 304 http://registry.npmjs.org/duplexer2 4169ms (from cache)
120 http fetch GET 304 http://registry.npmjs.org/through2 4179ms (from cache)
121 http fetch GET 304 http://registry.npmjs.org/fstream-ignore 4133ms (from cache)
122 http fetch GET 304 http://registry.npmjs.org/readable-stream 4169ms (from cache)
123 http fetch GET 304 http://registry.npmjs.org/rimraf 4200ms (from cache)
124 http fetch GET 304 http://registry.npmjs.org/uid-number 4526ms (from cache)
125 http fetch GET 304 http://registry.npmjs.org/builtins 4520ms (from cache)
126 http fetch GET 304 http://registry.npmjs.org/rimraf 4536ms (from cache)
127 http fetch GET 304 http://registry.npmjs.org/ansi-escapes 4660ms (from cache)
128 http fetch GET 304 http://registry.npmjs.org/tar 4601ms (from cache)
129 http fetch GET 304 http://registry.npmjs.org/shebang-command 5758ms (from cache)
130 http fetch GET 304 http://registry.npmjs.org/once 9981ms (from cache)
131 timing idealTree:node_modules/create-react-app Completed in 10102ms
132 silly placeDep node_modules/create-react-app ansi-styles@4.3.0 OK for: chalk@4.1.0 want: ^4.1.0
133 silly placeDep node_modules/create-react-app supports-color@7.2.0 OK for: chalk@4.1.0 want: ^7.1.0
134 silly fetch manifest color-convert@^2.0.1
135 silly fetch manifest has-flag@^4.0.0
136 http fetch GET 304 http://registry.npmjs.org/has-flag 4131ms (from cache)
137 http fetch GET 304 http://registry.npmjs.org/color-convert 4168ms (from cache)
138 timing idealTree:node_modules/create-react-app/node_modules/chalk Completed in 4176ms
139 silly placeDep node_modules/create-react-app color-convert@2.0.1 OK for: ansi-styles@4.3.0 want: ^2.0.1
140 silly fetch manifest color-name@~1.1.4
141 http fetch GET 304 http://registry.npmjs.org/color-name 3286ms (from cache)
142 timing idealTree:node_modules/create-react-app/node_modules/ansi-styles Completed in 3291ms
143 silly placeDep node_modules/create-react-app color-name@1.1.4 OK for: color-convert@2.0.1 want: ~1.1.4
144 timing idealTree:node_modules/create-react-app/node_modules/color-convert Completed in 2ms
145 timing idealTree:node_modules/create-react-app/node_modules/color-name Completed in 0ms
146 timing idealTree:node_modules/create-react-app/node_modules/commander Completed in 0ms
147 silly placeDep node_modules/create-react-app path-key@3.1.1 OK for: cross-spawn@7.0.3 want: ^3.1.0
148 silly placeDep node_modules/create-react-app shebang-command@2.0.0 OK for: cross-spawn@7.0.3 want: ^2.0.0
149 silly placeDep node_modules/create-react-app which@2.0.2 OK for: cross-spawn@7.0.3 want: ^2.0.1
150 silly fetch manifest shebang-regex@^3.0.0
151 silly fetch manifest isexe@^2.0.0
152 http fetch GET 304 http://registry.npmjs.org/shebang-regex 1543ms (from cache)
153 http fetch GET 304 http://registry.npmjs.org/isexe 2212ms (from cache)
154 timing idealTree:node_modules/create-react-app/node_modules/cross-spawn Completed in 2223ms
155 timing idealTree:node_modules/create-react-app/node_modules/envinfo Completed in 0ms
156 silly placeDep node_modules/create-react-app at-least-node@1.0.0 OK for: fs-extra@9.0.1 want: ^1.0.0
157 silly placeDep node_modules/create-react-app graceful-fs@4.2.4 OK for: fs-extra@9.0.1 want: ^4.2.0
158 silly placeDep node_modules/create-react-app jsonfile@6.1.0 OK for: fs-extra@9.0.1 want: ^6.0.1
159 silly placeDep node_modules/create-react-app universalify@1.0.0 OK for: fs-extra@9.0.1 want: ^1.0.0
160 silly fetch manifest universalify@^2.0.0
161 http fetch GET 304 http://registry.npmjs.org/universalify 387ms (from cache)
162 timing idealTree:node_modules/create-react-app/node_modules/fs-extra Completed in 399ms
163 timing idealTree:node_modules/create-react-app/node_modules/at-least-node Completed in 0ms
164 timing idealTree:node_modules/create-react-app/node_modules/graceful-fs Completed in 0ms
165 silly placeDep node_modules/create-react-app buffer-from@0.1.2 OK for: hyperquest@2.1.3 want: ^0.1.1
166 silly placeDep node_modules/create-react-app duplexer2@0.0.2 OK for: hyperquest@2.1.3 want: ~0.0.2
167 silly placeDep node_modules/create-react-app through2@0.6.5 OK for: hyperquest@2.1.3 want: ~0.6.3
168 silly fetch manifest readable-stream@~1.1.9
169 silly fetch manifest readable-stream@>=1.0.33-1 <1.1.0-0
170 silly fetch manifest xtend@>=4.0.0 <4.1.0-0
171 http fetch GET 304 http://registry.npmjs.org/readable-stream 391ms (from cache)
172 http fetch GET 304 http://registry.npmjs.org/readable-stream 468ms (from cache)
173 http fetch GET 304 http://registry.npmjs.org/xtend 568ms (from cache)
174 timing idealTree:node_modules/create-react-app/node_modules/hyperquest Completed in 581ms
175 timing idealTree:node_modules/create-react-app/node_modules/buffer-from Completed in 0ms
176 silly placeDep node_modules/create-react-app readable-stream@1.1.14 OK for: duplexer2@0.0.2 want: ~1.1.9
177 silly fetch manifest core-util-is@~1.0.0
178 silly fetch manifest isarray@0.0.1
179 silly fetch manifest string_decoder@~0.10.x
180 silly fetch manifest inherits@~2.0.1
181 http fetch GET 304 http://registry.npmjs.org/string_decoder 1910ms (from cache)
182 http fetch GET 304 http://registry.npmjs.org/inherits 1923ms (from cache)
183 http fetch GET 304 http://registry.npmjs.org/isarray 2011ms (from cache)
184 http fetch GET 304 http://registry.npmjs.org/core-util-is 2059ms (from cache)
185 timing idealTree:node_modules/create-react-app/node_modules/duplexer2 Completed in 2066ms
186 silly placeDep node_modules/create-react-app ansi-escapes@ OK for: inquirer@7.3.3 want: ^4.2.1
187 silly placeDep node_modules/create-react-app cli-cursor@3.1.0 OK for: inquirer@7.3.3 want: ^3.1.0
188 silly placeDep node_modules/create-react-app cli-width@3.0.0 OK for: inquirer@7.3.3 want: ^3.0.0
189 silly placeDep node_modules/create-react-app external-editor@3.1.0 OK for: inquirer@7.3.3 want: ^3.0.3
190 silly placeDep node_modules/create-react-app figures@3.2.0 OK for: inquirer@7.3.3 want: ^3.0.0
191 silly placeDep node_modules/create-react-app lodash@ OK for: inquirer@7.3.3 want: ^4.17.19
192 silly placeDep node_modules/create-react-app mute-stream@0.0.8 OK for: inquirer@7.3.3 want: 0.0.8
193 silly placeDep node_modules/create-react-app run-async@2.4.1 OK for: inquirer@7.3.3 want: ^2.4.0
194 silly placeDep node_modules/create-react-app rxjs@ OK for: inquirer@7.3.3 want: ^6.6.0
195 silly placeDep node_modules/create-react-app string-width@4.2.0 OK for: inquirer@7.3.3 want: ^4.1.0
196 silly placeDep node_modules/create-react-app strip-ansi@6.0.0 OK for: inquirer@7.3.3 want: ^6.0.0
197 silly placeDep node_modules/create-react-app through@2.3.8 OK for: inquirer@7.3.3 want: ^2.3.6
198 silly fetch manifest restore-cursor@^3.1.0
199 silly fetch manifest chardet@^0.7.0
200 silly fetch manifest iconv-lite@^0.4.24
201 silly fetch manifest tmp@^0.0.33
202 silly fetch manifest escape-string-regexp@^1.0.5
203 silly fetch manifest emoji-regex@^8.0.0
204 silly fetch manifest is-fullwidth-code-point@^3.0.0
205 silly fetch manifest ansi-regex@^5.0.0
206 http fetch GET 304 http://registry.npmjs.org/restore-cursor 2954ms (from cache)
207 http fetch GET 304 http://registry.npmjs.org/iconv-lite 2955ms (from cache)
208 http fetch GET 304 http://registry.npmjs.org/tmp 3027ms (from cache)
209 http fetch GET 304 http://registry.npmjs.org/escape-string-regexp 3040ms (from cache)
210 http fetch GET 304 http://registry.npmjs.org/emoji-regex 3054ms (from cache)
211 http fetch GET 304 http://registry.npmjs.org/chardet 3129ms (from cache)
212 http fetch GET 304 http://registry.npmjs.org/is-fullwidth-code-point 5774ms (from cache)
213 http fetch GET 304 http://registry.npmjs.org/ansi-regex 5811ms (from cache)
214 timing idealTree:node_modules/create-react-app/node_modules/inquirer Completed in 5883ms
215 timing idealTree:node_modules/create-react-app/node_modules/ansi-escapes Completed in 0ms
216 silly placeDep node_modules/create-react-app restore-cursor@3.1.0 OK for: cli-cursor@3.1.0 want: ^3.1.0
217 silly fetch manifest onetime@^5.1.0
218 silly fetch manifest signal-exit@^3.0.2
219 http fetch GET 304 http://registry.npmjs.org/onetime 1230ms (from cache)
220 http fetch GET 304 http://registry.npmjs.org/signal-exit 1276ms (from cache)
221 timing idealTree:node_modules/create-react-app/node_modules/cli-cursor Completed in 1282ms
222 timing idealTree:node_modules/create-react-app/node_modules/cli-width Completed in 0ms
223 silly placeDep node_modules/create-react-app chardet@0.7.0 OK for: external-editor@3.1.0 want: ^0.7.0
224 silly placeDep node_modules/create-react-app iconv-lite@0.4.24 OK for: external-editor@3.1.0 want: ^0.4.24
225 silly placeDep node_modules/create-react-app/node_modules/external-editor tmp@0.0.33 OK for: external-editor@3.1.0 want: ^0.0.33
226 silly fetch manifest safer-buffer@>= 2.1.2 < 3
227 silly fetch manifest os-tmpdir@~1.0.2
228 http fetch GET 304 http://registry.npmjs.org/os-tmpdir 770ms (from cache)
229 http fetch GET 304 http://registry.npmjs.org/safer-buffer 783ms (from cache)
230 timing idealTree:node_modules/create-react-app/node_modules/external-editor Completed in 792ms
231 timing idealTree:node_modules/create-react-app/node_modules/chardet Completed in 0ms
232 silly placeDep node_modules/create-react-app escape-string-regexp@1.0.5 OK for: figures@3.2.0 want: ^1.0.5
233 timing idealTree:node_modules/create-react-app/node_modules/figures Completed in 3ms
234 timing idealTree:node_modules/create-react-app/node_modules/escape-string-regexp Completed in 0ms
235 silly placeDep node_modules/create-react-app safer-buffer@2.1.2 OK for: iconv-lite@0.4.24 want: >= 2.1.2 < 3
236 timing idealTree:node_modules/create-react-app/node_modules/iconv-lite Completed in 2ms
237 silly placeDep node_modules/create-react-app/node_modules/jsonfile universalify@2.0.0 OK for: jsonfile@6.1.0 want: ^2.0.0
238 timing idealTree:node_modules/create-react-app/node_modules/jsonfile Completed in 2ms
239 timing idealTree:node_modules/create-react-app/node_modules/lodash Completed in 1ms
240 timing idealTree:node_modules/create-react-app/node_modules/mute-stream Completed in 0ms
241 timing idealTree:node_modules/create-react-app/node_modules/path-key Completed in 0ms
242 silly placeDep node_modules/create-react-app core-util-is@1.0.2 OK for: readable-stream@1.1.14 want: ~1.0.0
243 silly placeDep node_modules/create-react-app inherits@2.0.4 OK for: readable-stream@1.1.14 want: ~2.0.1
244 silly placeDep node_modules/create-react-app isarray@0.0.1 OK for: readable-stream@1.1.14 want: 0.0.1
245 silly placeDep node_modules/create-react-app string_decoder@ OK for: readable-stream@1.1.14 want: ~0.10.x
246 timing idealTree:node_modules/create-react-app/node_modules/readable-stream Completed in 6ms
247 timing idealTree:node_modules/create-react-app/node_modules/core-util-is Completed in 1ms
248 timing idealTree:node_modules/create-react-app/node_modules/inherits Completed in 0ms
249 timing idealTree:node_modules/create-react-app/node_modules/isarray Completed in 0ms
250 silly placeDep node_modules/create-react-app onetime@5.1.2 OK for: restore-cursor@3.1.0 want: ^5.1.0
251 silly placeDep node_modules/create-react-app signal-exit@3.0.3 OK for: restore-cursor@3.1.0 want: ^3.0.2
252 silly fetch manifest mimic-fn@^2.1.0
253 http fetch GET 304 http://registry.npmjs.org/mimic-fn 525ms (from cache)
254 timing idealTree:node_modules/create-react-app/node_modules/restore-cursor Completed in 532ms
255 silly placeDep node_modules/create-react-app mimic-fn@2.1.0 OK for: onetime@5.1.2 want: ^2.1.0
256 timing idealTree:node_modules/create-react-app/node_modules/onetime Completed in 3ms
257 timing idealTree:node_modules/create-react-app/node_modules/mimic-fn Completed in 0ms
258 timing idealTree:node_modules/create-react-app/node_modules/run-async Completed in 0ms
259 timing idealTree:node_modules/create-react-app/node_modules/rxjs Completed in 0ms
260 timing idealTree:node_modules/create-react-app/node_modules/safer-buffer Completed in 0ms
261 timing idealTree:node_modules/create-react-app/node_modules/semver Completed in 0ms
262 silly placeDep node_modules/create-react-app shebang-regex@3.0.0 OK for: shebang-command@2.0.0 want: ^3.0.0
263 timing idealTree:node_modules/create-react-app/node_modules/shebang-command Completed in 3ms
264 timing idealTree:node_modules/create-react-app/node_modules/shebang-regex Completed in 0ms
265 timing idealTree:node_modules/create-react-app/node_modules/signal-exit Completed in 0ms
266 timing idealTree:node_modules/create-react-app/node_modules/string_decoder Completed in 0ms
267 silly placeDep node_modules/create-react-app emoji-regex@8.0.0 OK for: string-width@4.2.0 want: ^8.0.0
268 silly placeDep node_modules/create-react-app is-fullwidth-code-point@3.0.0 OK for: string-width@4.2.0 want: ^3.0.0
269 timing idealTree:node_modules/create-react-app/node_modules/string-width Completed in 5ms
270 timing idealTree:node_modules/create-react-app/node_modules/emoji-regex Completed in 0ms
271 timing idealTree:node_modules/create-react-app/node_modules/is-fullwidth-code-point Completed in 0ms
272 silly placeDep node_modules/create-react-app ansi-regex@5.0.0 OK for: strip-ansi@6.0.0 want: ^5.0.0
273 timing idealTree:node_modules/create-react-app/node_modules/strip-ansi Completed in 7ms
274 timing idealTree:node_modules/create-react-app/node_modules/ansi-regex Completed in 0ms
275 silly placeDep node_modules/create-react-app has-flag@4.0.0 OK for: supports-color@7.2.0 want: ^4.0.0
276 timing idealTree:node_modules/create-react-app/node_modules/supports-color Completed in 3ms
277 timing idealTree:node_modules/create-react-app/node_modules/has-flag Completed in 0ms
278 silly placeDep node_modules/create-react-app debug@ OK for: tar-pack@3.4.1 want: ^2.2.0
279 silly placeDep node_modules/create-react-app fstream@1.0.12 OK for: tar-pack@3.4.1 want: ^1.0.10
280 silly placeDep node_modules/create-react-app fstream-ignore@1.0.5 OK for: tar-pack@3.4.1 want: ^1.0.5
281 silly placeDep node_modules/create-react-app once@1.4.0 OK for: tar-pack@3.4.1 want: ^1.3.3
282 silly placeDep node_modules/create-react-app/node_modules/tar-pack readable-stream@2.3.7 OK for: tar-pack@3.4.1 want: ^2.1.4
283 silly placeDep node_modules/create-react-app rimraf@ OK for: tar-pack@3.4.1 want: ^2.5.1
284 silly placeDep node_modules/create-react-app tar@ OK for: tar-pack@3.4.1 want: ^2.2.1
285 silly placeDep node_modules/create-react-app uid-number@0.0.6 OK for: tar-pack@3.4.1 want: ^0.0.6
286 silly fetch manifest mkdirp@>=0.5 0
287 silly fetch manifest minimatch@^3.0.0
288 silly fetch manifest wrappy@1
289 silly fetch manifest isarray@~1.0.0
290 silly fetch manifest process-nextick-args@~2.0.0
291 silly fetch manifest safe-buffer@~5.1.1
292 silly fetch manifest util-deprecate@~1.0.1
293 http fetch GET 304 http://registry.npmjs.org/wrappy 1508ms (from cache)
294 http fetch GET 304 http://registry.npmjs.org/isarray 1522ms (from cache)
295 http fetch GET 304 http://registry.npmjs.org/minimatch 1553ms (from cache)
296 http fetch GET 304 http://registry.npmjs.org/util-deprecate 1596ms (from cache)
297 http fetch GET 304 http://registry.npmjs.org/mkdirp 1829ms (from cache)
298 http fetch GET 304 http://registry.npmjs.org/process-nextick-args 1841ms (from cache)
299 http fetch GET 304 http://registry.npmjs.org/safe-buffer 1892ms (from cache)
300 timing idealTree:node_modules/create-react-app/node_modules/tar-pack Completed in 1928ms
301 timing idealTree:node_modules/create-react-app/node_modules/debug Completed in 0ms
302 silly placeDep node_modules/create-react-app mkdirp@ OK for: fstream@1.0.12 want: >=0.5 0
303 timing idealTree:node_modules/create-react-app/node_modules/fstream Completed in 3ms
304 silly placeDep node_modules/create-react-app minimatch@ OK for: fstream-ignore@1.0.5 want: ^3.0.0
305 timing idealTree:node_modules/create-react-app/node_modules/fstream-ignore Completed in 2ms
306 timing idealTree:node_modules/create-react-app/node_modules/minimatch Completed in 0ms
307 timing idealTree:node_modules/create-react-app/node_modules/mkdirp Completed in 0ms
308 silly placeDep node_modules/create-react-app wrappy@1.0.2 OK for: once@1.4.0 want: 1
309 timing idealTree:node_modules/create-react-app/node_modules/once Completed in 2ms
310 timing idealTree:node_modules/create-react-app/node_modules/rimraf Completed in 0ms
311 timing idealTree:node_modules/create-react-app/node_modules/tar Completed in 0ms
312 timing idealTree:node_modules/create-react-app/node_modules/through Completed in 0ms
313 silly placeDep node_modules/create-react-app/node_modules/through2 readable-stream@1.0.34 OK for: through2@0.6.5 want: >=1.0.33-1 <1.1.0-0
314 silly placeDep node_modules/create-react-app xtend@4.0.2 OK for: through2@0.6.5 want: >=4.0.0 <4.1.0-0
315 timing idealTree:node_modules/create-react-app/node_modules/through2 Completed in 8ms
316 timing idealTree:node_modules/create-react-app/node_modules/tmp Completed in 0ms
317 timing idealTree:node_modules/create-react-app/node_modules/uid-number Completed in 0ms
318 timing idealTree:node_modules/create-react-app/node_modules/universalify Completed in 0ms
319 silly placeDep node_modules/create-react-app builtins@1.0.3 OK for: validate-npm-package-name@3.0.0 want: ^1.0.3
320 timing idealTree:node_modules/create-react-app/node_modules/validate-npm-package-name Completed in 3ms
321 timing idealTree:node_modules/create-react-app/node_modules/builtins Completed in 0ms
322 silly placeDep node_modules/create-react-app isexe@2.0.0 OK for: which@2.0.2 want: ^2.0.0
323 timing idealTree:node_modules/create-react-app/node_modules/which Completed in 2ms
324 timing idealTree:node_modules/create-react-app/node_modules/isexe Completed in 0ms
325 timing idealTree:node_modules/create-react-app/node_modules/wrappy Completed in 0ms
326 timing idealTree:node_modules/create-react-app/node_modules/xtend Completed in 0ms
327 silly placeDep node_modules/create-react-app os-tmpdir@1.0.2 OK for: tmp@0.0.33 want: ~1.0.2
328 timing idealTree:node_modules/create-react-app/node_modules/external-editor/node_modules/tmp Completed in 2ms
329 timing idealTree:node_modules/create-react-app/node_modules/os-tmpdir Completed in 0ms
330 timing idealTree:node_modules/create-react-app/node_modules/jsonfile/node_modules/universalify Completed in 0ms
331 silly placeDep node_modules/create-react-app/node_modules/tar-pack isarray@1.0.0 OK for: readable-stream@2.3.7 want: ~1.0.0
332 silly placeDep node_modules/create-react-app process-nextick-args@2.0.1 OK for: readable-stream@2.3.7 want: ~2.0.0
333 silly placeDep node_modules/create-react-app safe-buffer@5.1.2 OK for: readable-stream@2.3.7 want: ~5.1.1
334 silly placeDep node_modules/create-react-app util-deprecate@1.0.2 OK for: readable-stream@2.3.7 want: ~1.0.1
335 timing idealTree:node_modules/create-react-app/node_modules/tar-pack/node_modules/readable-stream Completed in 12ms
336 timing idealTree:node_modules/create-react-app/node_modules/process-nextick-args Completed in 0ms
337 timing idealTree:node_modules/create-react-app/node_modules/safe-buffer Completed in 0ms
338 timing idealTree:node_modules/create-react-app/node_modules/util-deprecate Completed in 0ms
339 timing idealTree:node_modules/create-react-app/node_modules/tar-pack/node_modules/isarray Completed in 0ms
340 timing idealTree:node_modules/create-react-app/node_modules/through2/node_modules/readable-stream Completed in 0ms
341 timing idealTree:buildDeps Completed in 79656ms
342 timing idealTree:fixDepFlags Completed in 5ms
343 timing idealTree Completed in 79674ms
344 timing command:install Completed in 79679ms
345 verbose type invalid-json
346 verbose stack FetchError: invalid json response body at http://registry.npmjs.org/ansi-escapes reason: Unexpected end of JSON input
346 verbose stack     at /usr/share/npm/node_modules/minipass-fetch/lib/body.js:77:31
346 verbose stack     at async Promise.all (index 12)
346 verbose stack     at async Arborist.[buildDepStep] (/usr/share/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:785:5)
346 verbose stack     at async Arborist.buildIdealTree (/usr/share/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:202:7)
346 verbose stack     at async Arborist.reify (/usr/share/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:121:5)
346 verbose stack     at async install (/usr/share/npm/lib/install.js:40:5)
347 verbose cwd /home/freduah
348 verbose Linux 5.5.0-kali2-amd64
349 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "create-react-app"
350 verbose node v12.19.0
351 verbose npm  v7.0.3
352 error code FETCH_ERROR
353 error errno FETCH_ERROR
354 error invalid json response body at http://registry.npmjs.org/ansi-escapes reason: Unexpected end of JSON input
355 verbose exit 1

Freduah Gideon
  • 1,262
  • 3
  • 12
  • 20
  • Can you provide the a print out of the logs please? It could be a simple fix as updating your version of npm. – meddy Oct 31 '20 at 19:24
  • do you mean this ?? `/home/freduah/.npm/_logs/2020-10-31T19_11_20_727Z-debug.log` – Freduah Gideon Oct 31 '20 at 19:24
  • 2
    try running `npm cache clean --force` and then `npm i` – meddy Oct 31 '20 at 19:29
  • I have tried yet it isn't working. I have uninstalled node and npm and i'm trying a fresh install all over again. Will let you know if it works – Freduah Gideon Oct 31 '20 at 19:58
  • @meddy It's still not working – Freduah Gideon Oct 31 '20 at 20:52
  • 1
    uninstall the create-react-app package and any of its dependencies and then try to reinstall to do a reinstall following these [instructions](https://create-react-app.dev/docs/getting-started/) – meddy Oct 31 '20 at 23:31
  • 1
    @FreduahGideon even I'm facing same problem, tried almost all solution on web like clearing cache, reinstalling different version of node etc, but still no help. How you resolved it – Vasanth Dec 13 '20 at 15:08
  • Same issue for `npm install --save typescript @types/node @types/react @types/react-dom @types/jest`. The answer from B3ns44d fixed it. – Anna Madsen Dec 29 '22 at 08:05

14 Answers14

68

Sometimes the issue is their cause of network bandwidth try to use

npm cache clean --force
B3ns44d
  • 836
  • 7
  • 9
  • I have to return to this answer several times now. I wonder why this particular line is not included in the routine to create a react app? – Marka A Feb 26 '21 at 20:48
  • 1
    Probably because it disables recommended protections... – Beulah Akindele Feb 28 '21 at 20:59
  • it's not. create react app issue, I have the same issue with angular CLI. so it's an npm issue maybe. – Muhammed Moussa Mar 11 '21 at 23:25
  • 1
    It's very sad why stackoverflow deletes answers solutions links which point to github. I mean why ? – Freduah Gideon May 03 '21 at 20:02
  • `~ $ npm cache clean --force bash: /data/data/com.termux/files/usr/bin/npm: No such file or directory`, `~ $ npm cache verify bash: /data/data/com.termux/files/usr/bin/npm: No such file or directory` – coco bar Sep 28 '22 at 03:19
31

you can do:

npm cache clean --force

actually in latest versions, you don't need to clear, you can:

npm cache verify
Hekmat
  • 588
  • 6
  • 19
6

For some weird reasons, none of these answers helped me. I discovered it was an issue with my proxy. I solved it following these steps:

npm cache clean --force

npm config rm proxy

npm config rm https-proxy

npm cache verify

Delete the node_modules folder and run

npm install

Buchi
  • 368
  • 1
  • 4
  • 16
5

It happens when you have proxy related issues. I solved it following these steps:

npm cache clean --force

npm config rm proxy

npm config rm https-proxy

npm cache verify

Delete the node_modules folder(if using existing package and then run below command otherwise just run below command in CLI)

npm set registry=https://registry.npmjs.org/

then try again whatever you have been installing the new package or just installing node_modules, if it gives you the same error then I recommend you to restart your laptop and run again these above commands

Saif Ullah
  • 2,067
  • 1
  • 8
  • 9
  • 1
    This is working and solved my problem. But I didn't use the npm set registry=https://registry.npmjs.org/ part. I just ran these commands. – Iroshana Dec 26 '22 at 14:52
2

Try npm cache clean --force,

if not just restart your pc.

2

This work for me

  1. login as sudo su and not just using sudo
  2. uninstall create-react-app: npm uninstall -g create-react-app
  3. force clean catche: npm cache clean --force
  4. SWITCH TO OTHER INTERNET ACCESS (I was using home wifi and it does not work, I don't know why. Maybe it's too slow or that the server of ISP has a corrupted cache. Then I switched to Mobile Data). (I got this idea after seeing the comment of @mydis in this NPM Install Error:Unexpected end of JSON input while parsing near '...nt-webpack-plugin":"0').
  5. re-install create-react-app: npm i -g create-react-app
  6. force clean catche again: npm cache clean --force
  7. try creating react-app again: create-react-app my-app

  • npm version 7.5.2
  • node version 12.22.5
  • react version 17.0.2
  • Debian 11 bullseye

I was blocked several days trying to solve this issue.

Dharman
  • 30,962
  • 25
  • 85
  • 135
1

I've faced the same issue today, and what worked out for me was to reinstall create-react-app forcefully using npm install --global --force create-react-app (or type npm i -g -f create-react-app instead, if you like its shorthand version).

If simply verifying cache using npm cache verify or force cleaning it using npm cache clean --force doesn't work for you, try uninstalling and reinstalling the create-react-app npm module, and I hope it gets working again!

Harshit Gupta
  • 187
  • 1
  • 11
0

it can happen if the package-lock.json is missing in the project

Matoeil
  • 6,851
  • 11
  • 54
  • 77
0

Delete node_modules folder and run the command:

npm install
Tyler2P
  • 2,324
  • 26
  • 22
  • 31
0

try remove

rm C:\Users\<User>\AppData\Local\npm-cache\
mdimai666
  • 699
  • 8
  • 14
  • 2
    A good answer will always include an explanation why this would solve the issue, so that the OP and any future readers can learn from it. – Tyler2P Oct 01 '22 at 17:25
0

I was facing the same issue. But I have solved this

You are trying to create a project by the create-react-app method.

  1. First of all remove this globally saved package
npm uninstall -g create-react-app
  1. After the successful uninstallation. Run
npx install create-react-app <project-name>

This will work for you.

0

For me... Turn off virus protection temporarily then run command.

I had this issue and tried all the above. My Virus protection was blocking access to the cache file. Something to do with malware protection. I turned it off while installing and it worked immediately.

Prior to that I tried:

  1. force clean - didn't work.
  2. uninstall and reinstall node. - didn't work.
  3. renaming and deleting cache file - didn't work.
  4. restarting pc - didn't work
  5. deleting node modules - didn't work.

Each instance is different. I don't mean to put down the previous suggestions. Simply turning off Bulldog virus protection worked for me. Remember to put it back on immediately after.

Bodink
  • 1
0

On Windows - actually running Powershell as administrator and using npm cache clean --force worked for me.

antew
  • 949
  • 8
  • 17
-1

Turn Off Your Anti Virus During Installation I think some antivirus detects the cache file and prevents installation. Then run npm i

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 27 '23 at 13:04
  • Please make more obvious what additional insight your post contributes beyond the existing answer https://stackoverflow.com/a/74489761/7733418 It currently gives an impression of only being "Thanks.",which is not considered an appropriate answer on StackOverflow. Please delete this, if you cannot [edit] to turn it into an answer according to [answer]. – Yunnosch Apr 28 '23 at 17:23
  • Thank you for the idea! I deleted node modules and then temporarily turned off my newly installed Microsoft defender, and it helped. I was able to install necessary packages without errors. I've got Windows 11 – Shirokuma chan Apr 28 '23 at 13:23