Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] npx failed: Cannot read property 'spec' of undefined #3021

Closed
Tracked by #397
caohuilin opened this issue Apr 3, 2021 · 15 comments
Closed
Tracked by #397

[BUG] npx failed: Cannot read property 'spec' of undefined #3021

caohuilin opened this issue Apr 3, 2021 · 15 comments
Labels
Bug thing that needs fixing cmd:exec related to `npx` Release 7.x work is associated with a specific npm 7 release

Comments

@caohuilin
Copy link

Current Behavior:

:~/code/jupiter-create-integration-test$ npx create-react-app --help
Need to install the following packages:
  create-react-app
Ok to proceed? (y) y
npm ERR! Cannot read property 'spec' of undefined

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/caohuilin/.npm/_logs/2021-04-03T07_54_16_109Z-debug.log

Expected Behavior:

Steps To Reproduce:

Environment:

lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 9.11 (stretch)
Release:        9.11
Codename:       stretch

node -v
v14.15.4

npm -v
7.8.0

LOG

0 verbose cli [
0 verbose cli '/data00/home/caohuilin/.nvm/versions/node/v14.15.4/bin/node',
0 verbose cli '/data00/home/caohuilin/.nvm/versions/node/v14.15.4/lib/node_modules/npm/bin/npm-cli.js',
0 verbose cli 'exec',
0 verbose cli '--',
0 verbose cli 'create-react-app',
0 verbose cli '--help'
0 verbose cli ]
1 info using [email protected]
2 info using [email protected]
3 timing npm:load:whichnode Completed in 2ms
4 timing config:load:defaults Completed in 2ms
5 timing config:load:file:/data00/home/caohuilin/.nvm/versions/node/v14.15.4/lib/node_modules/npm/npmrc Completed in 1ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 2ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/data00/home/caohuilin/code/jupiter-create-integration-test/.npmrc Completed in 0ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:/home/caohuilin/.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:/home/caohuilin/.nvm/versions/node/v14.15.4/etc/npmrc Completed in 1ms
14 timing config:load:global Completed in 1ms
15 timing config:load:validate Completed in 1ms
16 timing config:load:setEnvs Completed in 1ms
17 timing config:load Completed in 9ms
18 timing npm:load:configload Completed in 9ms
19 timing npm:load:setTitle Completed in 0ms
20 timing npm:load:setupLog Completed in 1ms
21 timing npm:load:cleanupLog Completed in 2ms
22 timing npm:load:configScope Completed in 0ms
23 timing npm:load:projectScope Completed in 0ms
24 timing npm:load Completed in 15ms
25 timing config:load:flatten Completed in 3ms
26 timing arborist:ctor Completed in 0ms
27 timing arborist:ctor Completed in 0ms
28 timing arborist:ctor Completed in 0ms
29 timing idealTree:init Completed in 5ms
30 timing idealTree:userRequests Completed in 2ms
31 silly idealTree buildDeps
32 silly fetch manifest create-react-app@*
33 http fetch GET 304 https://bnpm.byted.org/create-react-app 60ms (from cache)
34 silly placeDep ROOT [email protected] OK for: want: *
35 silly fetch manifest [email protected]
36 silly fetch manifest [email protected]
37 silly fetch manifest [email protected]
38 silly fetch manifest [email protected]
39 silly fetch manifest [email protected]
40 silly fetch manifest [email protected]
41 silly fetch manifest [email protected]
42 silly fetch manifest [email protected]
43 silly fetch manifest [email protected]
44 silly fetch manifest [email protected]
45 silly fetch manifest [email protected]
46 http fetch GET 304 https://bnpm.byted.org/commander 66ms (from cache)
47 http fetch GET 304 https://bnpm.byted.org/hyperquest 108ms (from cache)
48 http fetch GET 304 https://bnpm.byted.org/envinfo 113ms (from cache)
49 http fetch GET 304 https://bnpm.byted.org/chalk 117ms (from cache)
50 http fetch GET 304 https://bnpm.byted.org/fs-extra 128ms (from cache)
51 http fetch GET 304 https://bnpm.byted.org/tmp 125ms (from cache)
52 http fetch GET 304 https://bnpm.byted.org/tar-pack 129ms (from cache)
53 http fetch GET 304 https://bnpm.byted.org/prompts 133ms (from cache)
54 http fetch GET 304 https://bnpm.byted.org/validate-npm-package-name 133ms (from cache)
55 http fetch GET 304 https://bnpm.byted.org/semver 139ms (from cache)
56 http fetch GET 304 https://bnpm.byted.org/cross-spawn 333ms (from cache)
57 timing idealTree:#root Completed in 401ms
58 silly placeDep ROOT [email protected] OK for: [email protected] want: 4.1.0
59 silly placeDep ROOT [email protected] OK for: [email protected] want: 4.1.1
60 silly placeDep ROOT [email protected] OK for: [email protected] want: 7.0.3
61 silly placeDep ROOT [email protected] OK for: [email protected] want: 7.7.3
62 silly placeDep ROOT [email protected] OK for: [email protected] want: 9.0.1
63 silly placeDep ROOT [email protected] OK for: [email protected] want: 2.1.3
64 silly placeDep ROOT [email protected] OK for: [email protected] want: 2.4.0
65 silly placeDep ROOT [email protected] OK for: [email protected] want: 7.3.2
66 silly placeDep ROOT [email protected] OK for: [email protected] want: 3.4.1
67 silly placeDep ROOT [email protected] OK for: [email protected] want: 0.2.1
68 silly placeDep ROOT [email protected] OK for: [email protected] want: 3.0.0
69 silly fetch manifest ansi-styles@^4.1.0
70 silly fetch manifest supports-color@^7.1.0
71 silly fetch manifest path-key@^3.1.0
72 silly fetch manifest shebang-command@^2.0.0
73 silly fetch manifest which@^2.0.1
74 silly fetch manifest at-least-node@^1.0.0
75 silly fetch manifest graceful-fs@^4.2.0
76 silly fetch manifest jsonfile@^6.0.1
77 silly fetch manifest universalify@^1.0.0
78 silly fetch manifest buffer-from@^0.1.1
79 silly fetch manifest duplexer2@~0.0.2
80 silly fetch manifest through2@~0.6.3
81 silly fetch manifest kleur@^3.0.3
82 silly fetch manifest sisteransi@^1.0.5
83 silly fetch manifest debug@^2.2.0
84 silly fetch manifest fstream@^1.0.10
85 silly fetch manifest fstream-ignore@^1.0.5
86 silly fetch manifest once@^1.3.3
87 silly fetch manifest readable-stream@^2.1.4
88 silly fetch manifest rimraf@^2.5.1
89 silly fetch manifest tar@^2.2.1
90 silly fetch manifest uid-number@^0.0.6
91 silly fetch manifest rimraf@^3.0.0
92 silly fetch manifest builtins@^1.0.3
93 http fetch GET 304 https://bnpm.byted.org/supports-color 106ms (from cache)
94 http fetch GET 304 https://bnpm.byted.org/path-key 117ms (from cache)
95 http fetch GET 304 https://bnpm.byted.org/at-least-node 156ms (from cache)
96 http fetch GET 304 https://bnpm.byted.org/which 161ms (from cache)
97 http fetch GET 304 https://bnpm.byted.org/ansi-styles 168ms (from cache)
98 http fetch GET 304 https://bnpm.byted.org/universalify 165ms (from cache)
99 http fetch GET 304 https://bnpm.byted.org/graceful-fs 170ms (from cache)
100 http fetch GET 304 https://bnpm.byted.org/jsonfile 172ms (from cache)
101 http fetch GET 304 https://bnpm.byted.org/kleur 171ms (from cache)
102 http fetch GET 304 https://bnpm.byted.org/shebang-command 181ms (from cache)
103 http fetch GET 304 https://bnpm.byted.org/buffer-from 185ms (from cache)
104 http fetch GET 304 https://bnpm.byted.org/through2 185ms (from cache)
105 http fetch GET 304 https://bnpm.byted.org/readable-stream 183ms (from cache)
106 http fetch GET 304 https://bnpm.byted.org/uid-number 184ms (from cache)
107 http fetch GET 304 https://bnpm.byted.org/fstream 190ms (from cache)
108 http fetch GET 304 https://bnpm.byted.org/sisteransi 199ms (from cache)
109 http fetch GET 304 https://bnpm.byted.org/once 192ms (from cache)
110 http fetch GET 304 https://bnpm.byted.org/tar 191ms (from cache)
111 http fetch GET 304 https://bnpm.byted.org/fstream-ignore 197ms (from cache)
112 http fetch GET 304 https://bnpm.byted.org/builtins 199ms (from cache)
113 http fetch GET 304 https://bnpm.byted.org/duplexer2 215ms (from cache)
114 http fetch GET 304 https://bnpm.byted.org/debug 212ms (from cache)
115 http fetch GET 304 https://bnpm.byted.org/rimraf 207ms (from cache)
116 timing idealTree:node_modules/create-react-app Completed in 239ms
117 silly placeDep ROOT [email protected] OK for: [email protected] want: ^4.1.0
118 silly placeDep ROOT [email protected] OK for: [email protected] want: ^7.1.0
119 silly fetch manifest color-convert@^2.0.1
120 silly fetch manifest has-flag@^4.0.0
121 http fetch GET 304 https://bnpm.byted.org/color-convert 45ms (from cache)
122 http fetch GET 304 https://bnpm.byted.org/has-flag 52ms (from cache)
123 timing idealTree:node_modules/chalk Completed in 56ms
124 silly placeDep ROOT [email protected] OK for: [email protected] want: ^2.0.1
125 silly fetch manifest color-name@~1.1.4
126 http fetch GET 304 https://bnpm.byted.org/color-name 53ms (from cache)
127 timing idealTree:node_modules/ansi-styles Completed in 56ms
128 silly placeDep ROOT [email protected] OK for: [email protected] want: ~1.1.4
129 timing idealTree:node_modules/color-convert Completed in 1ms
130 timing idealTree:node_modules/color-name Completed in 0ms
131 timing idealTree:node_modules/commander Completed in 0ms
132 silly placeDep ROOT [email protected] OK for: [email protected] want: ^3.1.0
133 silly placeDep ROOT [email protected] OK for: [email protected] want: ^2.0.0
134 silly placeDep ROOT [email protected] OK for: [email protected] want: ^2.0.1
135 silly fetch manifest shebang-regex@^3.0.0
136 silly fetch manifest isexe@^2.0.0
137 http fetch GET 304 https://bnpm.byted.org/isexe 45ms (from cache)
138 http fetch GET 304 https://bnpm.byted.org/shebang-regex 48ms (from cache)
139 timing idealTree:node_modules/cross-spawn Completed in 53ms
140 timing idealTree:node_modules/envinfo Completed in 0ms
141 silly placeDep ROOT [email protected] OK for: [email protected] want: ^1.0.0
142 silly placeDep ROOT [email protected] OK for: [email protected] want: ^4.2.0
143 silly placeDep ROOT [email protected] OK for: [email protected] want: ^6.0.1
144 silly placeDep ROOT [email protected] OK for: [email protected] want: ^1.0.0
145 silly fetch manifest universalify@^2.0.0
146 timing idealTree:node_modules/fs-extra Completed in 5ms
147 timing idealTree:node_modules/at-least-node Completed in 0ms
148 timing idealTree:node_modules/graceful-fs Completed in 0ms
149 silly placeDep ROOT [email protected] OK for: [email protected] want: ^0.1.1
150 silly placeDep ROOT [email protected] OK for: [email protected] want: ~0.0.2
151 silly placeDep ROOT [email protected] OK for: [email protected] want: ~0.6.3
152 silly fetch manifest readable-stream@~1.1.9
153 silly fetch manifest readable-stream@>=1.0.33-1 <1.1.0-0
154 silly fetch manifest xtend@>=4.0.0 <4.1.0-0
155 http fetch GET 304 https://bnpm.byted.org/xtend 48ms (from cache)
156 timing idealTree:node_modules/hyperquest Completed in 53ms
157 timing idealTree:node_modules/buffer-from Completed in 0ms
158 silly placeDep ROOT [email protected] OK for: [email protected] want: ~1.1.9
159 silly fetch manifest core-util-is@~1.0.0
160 silly fetch manifest [email protected]
161 silly fetch manifest string_decoder@~0.10.x
162 silly fetch manifest inherits@~2.0.1
163 http fetch GET 304 https://bnpm.byted.org/string_decoder 45ms (from cache)
164 http fetch GET 304 https://bnpm.byted.org/core-util-is 51ms (from cache)
165 http fetch GET 304 https://bnpm.byted.org/isarray 51ms (from cache)
166 http fetch GET 304 https://bnpm.byted.org/inherits 56ms (from cache)
167 timing idealTree:node_modules/duplexer2 Completed in 62ms
168 silly placeDep node_modules/jsonfile [email protected] OK for: [email protected] want: ^2.0.0
169 timing idealTree:node_modules/jsonfile Completed in 1ms
170 timing idealTree:node_modules/path-key Completed in 0ms
171 silly placeDep ROOT [email protected] OK for: [email protected] want: ^3.0.3
172 silly placeDep ROOT [email protected] OK for: [email protected] want: ^1.0.5
173 timing idealTree:node_modules/prompts Completed in 2ms
174 timing idealTree:node_modules/kleur Completed in 0ms
175 silly placeDep ROOT [email protected] OK for: [email protected] want: ~1.0.0
176 silly placeDep ROOT [email protected] OK for: [email protected] want: ~2.0.1
177 silly placeDep ROOT [email protected] OK for: [email protected] want: 0.0.1
178 silly placeDep ROOT [email protected] OK for: [email protected] want: ~0.10.x
179 timing idealTree:node_modules/readable-stream Completed in 2ms
180 timing idealTree:node_modules/core-util-is Completed in 0ms
181 timing idealTree:node_modules/inherits Completed in 0ms
182 timing idealTree:node_modules/isarray Completed in 0ms
183 timing idealTree:node_modules/semver Completed in 0ms
184 silly placeDep ROOT [email protected] OK for: [email protected] want: ^3.0.0
185 timing idealTree:node_modules/shebang-command Completed in 1ms
186 timing idealTree:node_modules/shebang-regex Completed in 0ms
187 timing idealTree:node_modules/sisteransi Completed in 0ms
188 timing idealTree:node_modules/string_decoder Completed in 0ms
189 silly placeDep ROOT [email protected] OK for: [email protected] want: ^4.0.0
190 timing idealTree:node_modules/supports-color Completed in 1ms
191 timing idealTree:node_modules/has-flag Completed in 0ms
192 silly placeDep ROOT [email protected] OK for: [email protected] want: ^2.2.0
193 silly placeDep ROOT [email protected] OK for: [email protected] want: ^1.0.10
194 silly placeDep ROOT [email protected] OK for: [email protected] want: ^1.0.5
195 silly placeDep ROOT [email protected] OK for: [email protected] want: ^1.3.3
196 silly placeDep node_modules/tar-pack [email protected] OK for: [email protected] want: ^2.1.4
197 silly placeDep ROOT [email protected] OK for: [email protected] want: ^2.5.1
198 silly placeDep ROOT [email protected] OK for: [email protected] want: ^2.2.1
199 silly placeDep ROOT [email protected] OK for: [email protected] want: ^0.0.6
200 silly fetch manifest [email protected]
201 silly fetch manifest mkdirp@>=0.5 0
202 silly fetch manifest minimatch@^3.0.0
203 silly fetch manifest wrappy@1
204 silly fetch manifest isarray@~1.0.0
205 silly fetch manifest process-nextick-args@~2.0.0
206 silly fetch manifest safe-buffer@~5.1.1
207 silly fetch manifest string_decoder@~1.1.1
208 silly fetch manifest util-deprecate@~1.0.1
209 silly fetch manifest glob@^7.1.3
210 silly fetch manifest block-stream@*
211 http fetch GET 304 https://bnpm.byted.org/util-deprecate 67ms (from cache)
212 http fetch GET 304 https://bnpm.byted.org/mkdirp 72ms (from cache)
213 http fetch GET 304 https://bnpm.byted.org/wrappy 74ms (from cache)
214 http fetch GET 304 https://bnpm.byted.org/ms 81ms (from cache)
215 http fetch GET 304 https://bnpm.byted.org/safe-buffer 78ms (from cache)
216 http fetch GET 304 https://bnpm.byted.org/minimatch 85ms (from cache)
217 http fetch GET 304 https://bnpm.byted.org/block-stream 91ms (from cache)
218 http fetch GET 304 https://bnpm.byted.org/process-nextick-args 96ms (from cache)
219 http fetch GET 304 https://bnpm.byted.org/glob 98ms (from cache)
220 timing idealTree:node_modules/tar-pack Completed in 110ms
221 silly placeDep ROOT [email protected] OK for: [email protected] want: 2.0.0
222 timing idealTree:node_modules/debug Completed in 1ms
223 silly placeDep ROOT [email protected] OK for: [email protected] want: >=0.5 0
224 silly fetch manifest minimist@^1.2.5
225 http fetch GET 304 https://bnpm.byted.org/minimist 40ms (from cache)
226 timing idealTree:node_modules/fstream Completed in 43ms
227 silly placeDep ROOT [email protected] OK for: [email protected] want: ^3.0.0
228 silly fetch manifest brace-expansion@^1.1.7
229 http fetch GET 304 https://bnpm.byted.org/brace-expansion 38ms (from cache)
230 timing idealTree:node_modules/fstream-ignore Completed in 41ms
231 silly placeDep ROOT [email protected] OK for: [email protected] want: ^1.1.7
232 silly fetch manifest balanced-match@^1.0.0
233 silly fetch manifest [email protected]
234 http fetch GET 304 https://bnpm.byted.org/concat-map 46ms (from cache)
235 http fetch GET 304 https://bnpm.byted.org/balanced-match 50ms (from cache)
236 timing idealTree:node_modules/minimatch Completed in 52ms
237 silly placeDep ROOT [email protected] OK for: [email protected] want: ^1.0.0
238 silly placeDep ROOT [email protected] OK for: [email protected] want: 0.0.1
239 timing idealTree:node_modules/brace-expansion Completed in 1ms
240 timing idealTree:node_modules/balanced-match Completed in 0ms
241 timing idealTree:node_modules/concat-map Completed in 0ms
242 silly placeDep ROOT [email protected] OK for: [email protected] want: ^1.2.5
243 timing idealTree:node_modules/mkdirp Completed in 0ms
244 timing idealTree:node_modules/minimist Completed in 0ms
245 timing idealTree:node_modules/ms Completed in 0ms
246 silly placeDep ROOT [email protected] OK for: [email protected] want: 1
247 timing idealTree:node_modules/once Completed in 0ms
248 silly placeDep ROOT [email protected] OK for: [email protected] want: ^7.1.3
249 silly fetch manifest fs.realpath@^1.0.0
250 silly fetch manifest inflight@^1.0.4
251 silly fetch manifest path-is-absolute@^1.0.0
252 http fetch GET 304 https://bnpm.byted.org/path-is-absolute 47ms (from cache)
253 http fetch GET 304 https://bnpm.byted.org/inflight 50ms (from cache)
254 http fetch GET 304 https://bnpm.byted.org/fs.realpath 53ms (from cache)
255 timing idealTree:node_modules/rimraf Completed in 55ms
256 silly placeDep ROOT [email protected] OK for: [email protected] want: ^1.0.0
257 silly placeDep ROOT [email protected] OK for: [email protected] want: ^1.0.4
258 silly placeDep ROOT [email protected] OK for: [email protected] want: ^1.0.0
259 timing idealTree:node_modules/glob Completed in 2ms
260 timing idealTree:node_modules/fs.realpath Completed in 0ms
261 timing idealTree:node_modules/inflight Completed in 0ms
262 timing idealTree:node_modules/path-is-absolute Completed in 0ms
263 silly placeDep ROOT [email protected] OK for: [email protected] want: *
264 timing idealTree:node_modules/tar Completed in 3ms
265 timing idealTree:node_modules/block-stream Completed in 0ms
266 silly placeDep node_modules/through2 [email protected] OK for: [email protected] want: >=1.0.33-1 <1.1.0-0
267 silly placeDep ROOT [email protected] OK for: [email protected] want: >=4.0.0 <4.1.0-0
268 timing idealTree:node_modules/through2 Completed in 1ms
269 silly placeDep node_modules/tmp [email protected] OK for: [email protected] want: ^3.0.0
270 timing idealTree:node_modules/tmp Completed in 0ms
271 timing idealTree:node_modules/uid-number Completed in 0ms
272 timing idealTree:node_modules/universalify Completed in 0ms
273 silly placeDep ROOT [email protected] OK for: [email protected] want: ^1.0.3
274 timing idealTree:node_modules/validate-npm-package-name Completed in 0ms
275 timing idealTree:node_modules/builtins Completed in 0ms
276 silly placeDep ROOT [email protected] OK for: [email protected] want: ^2.0.0
277 timing idealTree:node_modules/which Completed in 0ms
278 timing idealTree:node_modules/isexe Completed in 0ms
279 timing idealTree:node_modules/wrappy Completed in 0ms
280 timing idealTree:node_modules/xtend Completed in 0ms
281 timing idealTree:node_modules/jsonfile/node_modules/universalify Completed in 0ms
282 silly placeDep node_modules/tar-pack [email protected] OK for: [email protected] want: ~1.0.0
283 silly placeDep ROOT [email protected] OK for: [email protected] want: ~2.0.0
284 silly placeDep ROOT [email protected] OK for: [email protected] want: ~5.1.1
285 silly placeDep node_modules/tar-pack [email protected] OK for: [email protected] want: ~1.1.1
286 silly placeDep ROOT [email protected] OK for: [email protected] want: ~1.0.1
287 timing idealTree:node_modules/tar-pack/node_modules/readable-stream Completed in 2ms
288 timing idealTree:node_modules/process-nextick-args Completed in 0ms
289 timing idealTree:node_modules/safe-buffer Completed in 0ms
290 timing idealTree:node_modules/util-deprecate Completed in 0ms
291 timing idealTree:node_modules/tar-pack/node_modules/isarray Completed in 0ms
292 timing idealTree:node_modules/tar-pack/node_modules/string_decoder Completed in 0ms
293 timing idealTree:node_modules/through2/node_modules/readable-stream Completed in 0ms
294 timing idealTree:node_modules/tmp/node_modules/rimraf Completed in 0ms
295 timing idealTree:buildDeps Completed in 1257ms
296 timing idealTree:fixDepFlags Completed in 1ms
297 timing idealTree Completed in 1266ms
298 timing reify:loadTrees Completed in 1266ms
299 timing reify:diffTrees Completed in 1ms
300 silly reify moves {}
301 timing reify:retireShallow Completed in 0ms
302 timing reify:createSparse Completed in 0ms
303 timing reify:loadBundles Completed in 0ms
304 timing reify:unpack Completed in 0ms
305 timing reify:unretire Completed in 0ms
306 timing build:queue Completed in 0ms
307 timing build:deps Completed in 0ms
308 timing build Completed in 0ms
309 timing reify:build Completed in 0ms
310 timing reify:trash Completed in 0ms
311 timing command:exec Completed in 5562ms
312 verbose stack TypeError: Cannot read property 'spec' of undefined
312 verbose stack at Arborist.[saveIdealTree] (/data00/home/caohuilin/.nvm/versions/node/v14.15.4/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:941:62)
312 verbose stack at /data00/home/caohuilin/.nvm/versions/node/v14.15.4/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:138:39
312 verbose stack at async Arborist.reify (/data00/home/caohuilin/.nvm/versions/node/v14.15.4/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:134:5)
312 verbose stack at async Exec._exec (/data00/home/caohuilin/.nvm/versions/node/v14.15.4/lib/node_modules/npm/lib/exec.js:224:9)
313 verbose cwd /data00/home/caohuilin/code/jupiter-create-integration-test
314 verbose Linux 4.14.81.bm.15-amd64
315 verbose argv "/data00/home/caohuilin/.nvm/versions/node/v14.15.4/bin/node" "/data00/home/caohuilin/.nvm/versions/node/v14.15.4/lib/node_modules/npm/bin/npm-cli.js" "exec" "--" "create-react-app" "--help"
316 verbose node v14.15.4
317 verbose npm v7.8.0
318 error Cannot read property 'spec' of undefined
319 verbose exit 1

@caohuilin caohuilin added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Apr 3, 2021
@caohuilin
Copy link
Author

image

@caohuilin
Copy link
Author

node -v
v14.16.0
npm -v
6.14.11

work fine

@nlf
Copy link
Contributor

nlf commented Apr 7, 2021

i can't reproduce this one, i'm using the same node and npm versions as you and when i run npx create-react-app --help i get the correct output.

is there anything unusual about your configuration? an alternative registry? proxy? can you share the output of npm config ls?

@caohuilin
Copy link
Author

image

@nlf
Copy link
Contributor

nlf commented Apr 9, 2021

i see you're using a different registry.. it could be that registry is not returning all of the metadata that we need in order to install completely.

with your current configuration, can you try creating an empty directory and running npm install create-react-app in it and see if you get the same error?

if you do, create a second empty directory and in that one run npm install create-react-app --registry=https://registry.npmjs.org and see if you get the same error

@caohuilin
Copy link
Author

npm install create-react-app is ok, but npx create-react-app --help also has error.

@caohuilin
Copy link
Author

image

@painotpi
Copy link

Seems like this is happening on Windows 10 as well,

Environment,

Node Version: 14.16.1
NPM/NPX Version: 7.13.0
OS: Windows 10
Terminal: Git bash

Logs,

1476 verbose stack TypeError: Cannot read property 'spec' of undefined
1476 verbose stack at Arborist.[saveIdealTree] (C:\Users\Sahil Kumar\AppData\Roaming\npm\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\reify.js:956:62)
1476 verbose stack at C:\Users\Sahil Kumar\AppData\Roaming\npm\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\reify.js:139:39
1476 verbose stack at async Arborist.reify (C:\Users\Sahil Kumar\AppData\Roaming\npm\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\reify.js:135:5)
1476 verbose stack at async exec (C:\Users\Sahil Kumar\AppData\Roaming\npm\node_modules\npm\node_modules\libnpmexec\lib\index.js:174:7)
1477 verbose cwd C:\Users\Sahil Kumar\Desktop
1478 verbose Windows_NT 10.0.19041
1479 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\Sahil Kumar\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "exec" "--" "create-nuxt-app" "my_pro"
1480 verbose node v14.16.1
1481 verbose npm v7.11.2
1482 error Cannot read property 'spec' of undefined
1483 verbose exit 1

Link to complete log
Link to StackOverflow question about the same issue

@darcyclarke
Copy link
Contributor

@caohuilin This seems to be an issue with the registry mirror you're configured against & not with the npm CLI itself; Can you try to see if installs/runs succeed in v6?

@darcyclarke darcyclarke removed the Needs Triage needs review for next steps label May 21, 2021
@caohuilin
Copy link
Author

@caohuilin This seems to be an issue with the registry mirror you're configured against & not with the npm CLI itself; Can you try to see if installs/runs succeed in v6?

yes,v6 is ok

@OZZlE
Copy link

OZZlE commented Oct 13, 2021

I have the same issue on Win10, I was using a different registry and proxies but I commented it out in .npmrc, from past testing it seems to read this file on every run so should be sufficient?

Work around (don't do this inside a node project folder!):

npm install create-react-app
node node_modules/create-react-app/index.js [name-of-project]
# press enter if it hangs??

Afterwards you can remove node_modules, package.json, package-lock.json in the folder you ran it

@JoshMcCullough
Copy link

We had legacy-peer-deps=true in our .npmrc because back when the big peer dep change happened, we ran into issues. Removing this config got me past this error.

@Xiaoming985
Copy link

@caohuilin Did you solved this problem? I also met this problem, and my node & npm version are same as yours. Could you help me?

@JoshMcCullough
Copy link

@Xiaoming985 maybe a long shot but would my comment before yours help?

@fritzy fritzy added the cmd:exec related to `npx` label Jul 25, 2022
@wraithgar
Copy link
Member

This does appear to be an issue with your local registry. Closing due to our inability to reproduce. If this is something you are still experiencing w/ the latest npm version and have a way to reproduce this locally, please open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing cmd:exec related to `npx` Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

9 participants