Skip to content
This repository has been archived by the owner on Sep 25, 2023. It is now read-only.

npm install fails - Cannot read property 'version' of undefined #5

Closed
dayvista opened this issue Feb 22, 2021 · 5 comments
Closed

npm install fails - Cannot read property 'version' of undefined #5

dayvista opened this issue Feb 22, 2021 · 5 comments

Comments

@dayvista
Copy link

dayvista commented Feb 22, 2021

When I try to install the package using npm install krabs, the process fails with an error: Cannot read property 'version' of undefined. The error seems to be related to the arborist package. Here is the debug log, error occurs at line 217:

0 verbose cli [
0 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
0 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
0 verbose cli   'install',
0 verbose cli   'krabs'
0 verbose cli ]
1 info using npm@7.5.4
2 info using node@v12.19.0
3 timing config:load:defaults Completed in 2ms
4 timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 1ms
5 timing config:load:builtin Completed in 1ms
6 timing config:load:cli Completed in 2ms
7 timing config:load:env Completed in 1ms
8 timing config:load:file:D:\Coding\krabs-test\.npmrc Completed in 0ms
9 timing config:load:project Completed in 1ms
10 timing config:load:file:C:\Users\liamd\.npmrc Completed in 1ms
11 timing config:load:user Completed in 1ms
12 timing config:load:file:C:\Program Files\nodejs\etc\npmrc Completed in 0ms
13 timing config:load:global Completed in 0ms
14 timing config:load:cafile Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:setUserAgent Completed in 0ms
17 timing config:load:setEnvs Completed in 2ms
18 timing config:load Completed in 11ms
19 verbose npm-session e0b79d589251c539
20 timing npm:load Completed in 26ms
21 timing arborist:ctor Completed in 2ms
22 timing idealTree:init Completed in 315ms
23 timing idealTree:userRequests Completed in 1ms
24 silly idealTree buildDeps
25 silly fetch manifest krabs@*
26 http fetch GET 200 https://registry.npmjs.org/krabs 78ms (from cache)
27 silly placeDep ROOT krabs@0.0.5 OK for: krabs-test@0.1.0 want: *
28 silly fetch manifest express@^4.17.1
29 silly fetch manifest krabs@^0.0.2
30 timing arborist:ctor Completed in 0ms
31 http fetch GET 304 https://registry.npmjs.org/express 523ms (from cache)
32 timing idealTree:#root Completed in 623ms
33 silly placeDep ROOT express@4.17.1 OK for: krabs@0.0.5 want: ^4.17.1
34 silly placeDep node_modules/krabs krabs@0.0.2 OK for: krabs@0.0.5 want: ^0.0.2
35 silly fetch manifest accepts@~1.3.7
36 silly fetch manifest array-flatten@1.1.1
37 silly fetch manifest body-parser@1.19.0
38 silly fetch manifest content-disposition@0.5.3
39 silly fetch manifest content-type@~1.0.4
40 silly fetch manifest cookie@0.4.0
41 silly fetch manifest cookie-signature@1.0.6
42 silly fetch manifest debug@2.6.9
43 silly fetch manifest encodeurl@~1.0.2
44 silly fetch manifest escape-html@~1.0.3
45 silly fetch manifest finalhandler@~1.1.2
46 silly fetch manifest fresh@0.5.2
47 silly fetch manifest merge-descriptors@1.0.1
48 silly fetch manifest methods@~1.1.2
49 silly fetch manifest on-finished@~2.3.0
50 silly fetch manifest parseurl@~1.3.3
51 silly fetch manifest path-to-regexp@0.1.7
52 silly fetch manifest proxy-addr@~2.0.5
53 silly fetch manifest qs@6.7.0
54 silly fetch manifest range-parser@~1.2.1
55 silly fetch manifest safe-buffer@5.1.2
56 silly fetch manifest send@0.17.1
57 silly fetch manifest serve-static@1.14.1
58 silly fetch manifest type-is@~1.6.18
59 silly fetch manifest utils-merge@1.0.1
60 silly fetch manifest vary@~1.1.2
61 silly fetch manifest next@^10.0.4
62 http fetch GET 304 https://registry.npmjs.org/accepts 385ms (from cache)
63 http fetch GET 304 https://registry.npmjs.org/merge-descriptors 373ms (from cache)
64 http fetch GET 304 https://registry.npmjs.org/methods 446ms (from cache)
65 http fetch GET 304 https://registry.npmjs.org/array-flatten 667ms (from cache)
66 http fetch GET 304 https://registry.npmjs.org/fresh 690ms (from cache)
67 http fetch GET 304 https://registry.npmjs.org/encodeurl 705ms (from cache)
68 http fetch GET 304 https://registry.npmjs.org/escape-html 711ms (from cache)
69 http fetch GET 304 https://registry.npmjs.org/finalhandler 712ms (from cache)
70 http fetch GET 304 https://registry.npmjs.org/content-type 781ms (from cache)
71 http fetch GET 304 https://registry.npmjs.org/body-parser 786ms (from cache)
72 http fetch GET 304 https://registry.npmjs.org/debug 779ms (from cache)
73 http fetch GET 304 https://registry.npmjs.org/content-disposition 822ms (from cache)
74 http fetch GET 304 https://registry.npmjs.org/cookie 820ms (from cache)
75 http fetch GET 304 https://registry.npmjs.org/cookie-signature 826ms (from cache)
76 http fetch GET 304 https://registry.npmjs.org/parseurl 811ms (from cache)
77 http fetch GET 304 https://registry.npmjs.org/on-finished 815ms (from cache)
78 http fetch GET 304 https://registry.npmjs.org/path-to-regexp 820ms (from cache)
79 http fetch GET 304 https://registry.npmjs.org/proxy-addr 824ms (from cache)
80 http fetch GET 304 https://registry.npmjs.org/range-parser 819ms (from cache)
81 http fetch GET 304 https://registry.npmjs.org/qs 825ms (from cache)
82 http fetch GET 304 https://registry.npmjs.org/safe-buffer 824ms (from cache)
83 http fetch GET 304 https://registry.npmjs.org/send 824ms (from cache)
84 http fetch GET 304 https://registry.npmjs.org/serve-static 824ms (from cache)
85 http fetch GET 304 https://registry.npmjs.org/vary 819ms (from cache)
86 http fetch GET 304 https://registry.npmjs.org/type-is 827ms (from cache)
87 http fetch GET 304 https://registry.npmjs.org/utils-merge 830ms (from cache)
88 http fetch GET 304 https://registry.npmjs.org/next 839ms (from cache)
89 silly timing Tried to end timer that doesn't exist: idealTree:#root
90 silly placeDep ROOT accepts@1.3.7 OK for: express@4.17.1 want: ~1.3.7
91 silly placeDep node_modules/express array-flatten@1.1.1 OK for: express@4.17.1 want: 1.1.1
92 silly placeDep ROOT body-parser@1.19.0 OK for: express@4.17.1 want: 1.19.0
93 silly placeDep ROOT content-disposition@0.5.3 OK for: express@4.17.1 want: 0.5.3
94 silly placeDep ROOT content-type@1.0.4 OK for: express@4.17.1 want: ~1.0.4
95 silly placeDep ROOT cookie@0.4.0 OK for: express@4.17.1 want: 0.4.0
96 silly placeDep ROOT cookie-signature@1.0.6 OK for: express@4.17.1 want: 1.0.6
97 silly placeDep ROOT debug@2.6.9 OK for: express@4.17.1 want: 2.6.9
98 silly placeDep ROOT encodeurl@1.0.2 OK for: express@4.17.1 want: ~1.0.2
99 silly placeDep ROOT escape-html@1.0.3 OK for: express@4.17.1 want: ~1.0.3
100 silly placeDep ROOT finalhandler@1.1.2 OK for: express@4.17.1 want: ~1.1.2
101 silly placeDep ROOT fresh@0.5.2 OK for: express@4.17.1 want: 0.5.2
102 silly placeDep ROOT merge-descriptors@1.0.1 OK for: express@4.17.1 want: 1.0.1
103 silly placeDep ROOT methods@1.1.2 OK for: express@4.17.1 want: ~1.1.2
104 silly placeDep ROOT on-finished@2.3.0 OK for: express@4.17.1 want: ~2.3.0
105 silly placeDep ROOT parseurl@1.3.3 OK for: express@4.17.1 want: ~1.3.3
106 silly placeDep ROOT path-to-regexp@0.1.7 OK for: express@4.17.1 want: 0.1.7
107 silly placeDep ROOT proxy-addr@2.0.6 OK for: express@4.17.1 want: ~2.0.5
108 silly placeDep ROOT qs@6.7.0 OK for: express@4.17.1 want: 6.7.0
109 silly placeDep ROOT range-parser@1.2.1 OK for: express@4.17.1 want: ~1.2.1
110 silly placeDep node_modules/express safe-buffer@5.1.2 OK for: express@4.17.1 want: 5.1.2
111 silly placeDep ROOT send@0.17.1 OK for: express@4.17.1 want: 0.17.1
112 silly placeDep ROOT serve-static@1.14.1 OK for: express@4.17.1 want: 1.14.1
113 silly placeDep ROOT type-is@1.6.18 OK for: express@4.17.1 want: ~1.6.18
114 silly placeDep ROOT utils-merge@1.0.1 OK for: express@4.17.1 want: 1.0.1
115 silly placeDep ROOT vary@1.1.2 OK for: express@4.17.1 want: ~1.1.2
116 silly fetch manifest mime-types@~2.1.24
117 silly fetch manifest negotiator@0.6.2
118 silly fetch manifest http-errors@1.7.2
119 silly fetch manifest raw-body@2.4.0
120 silly fetch manifest ms@2.0.0
121 silly fetch manifest ee-first@1.1.1
122 silly fetch manifest forwarded@~0.1.2
123 silly fetch manifest ipaddr.js@1.9.1
124 silly fetch manifest destroy@~1.0.4
125 silly fetch manifest mime@1.6.0
126 silly fetch manifest ms@2.1.1
127 silly fetch manifest media-typer@0.3.0
128 http fetch GET 304 https://registry.npmjs.org/negotiator 127ms (from cache)
129 http fetch GET 304 https://registry.npmjs.org/ee-first 180ms (from cache)
130 http fetch GET 304 https://registry.npmjs.org/mime-types 217ms (from cache)
131 http fetch GET 304 https://registry.npmjs.org/mime 205ms (from cache)
132 http fetch GET 304 https://registry.npmjs.org/media-typer 208ms (from cache)
133 http fetch GET 304 https://registry.npmjs.org/ipaddr.js 224ms (from cache)
134 http fetch GET 304 https://registry.npmjs.org/ms 230ms (from cache)
135 http fetch GET 304 https://registry.npmjs.org/destroy 226ms (from cache)
136 http fetch GET 304 https://registry.npmjs.org/http-errors 247ms (from cache)
137 http fetch GET 304 https://registry.npmjs.org/forwarded 234ms (from cache)
138 http fetch GET 304 https://registry.npmjs.org/raw-body 242ms (from cache)
139 timing idealTree:node_modules/express Completed in 294ms
140 silly placeDep ROOT mime-types@2.1.29 OK for: accepts@1.3.7 want: ~2.1.24
141 silly placeDep ROOT negotiator@0.6.2 OK for: accepts@1.3.7 want: 0.6.2
142 silly fetch manifest mime-db@1.46.0
143 http fetch GET 304 https://registry.npmjs.org/mime-db 96ms (from cache)
144 timing idealTree:node_modules/accepts Completed in 100ms
145 silly placeDep node_modules/body-parser http-errors@1.7.2 OK for: body-parser@1.19.0 want: 1.7.2
146 silly placeDep node_modules/body-parser raw-body@2.4.0 OK for: body-parser@1.19.0 want: 2.4.0
147 silly fetch manifest inherits@2.0.3
148 http fetch GET 304 https://registry.npmjs.org/inherits 102ms (from cache)
149 timing idealTree:node_modules/body-parser Completed in 112ms
150 silly placeDep node_modules/content-disposition safe-buffer@5.1.2 OK for: content-disposition@0.5.3 want: 5.1.2
151 timing idealTree:node_modules/content-disposition Completed in 1ms
152 timing idealTree:node_modules/content-type Completed in 0ms
153 timing idealTree:node_modules/cookie Completed in 0ms
154 timing idealTree:node_modules/cookie-signature Completed in 0ms
155 silly placeDep ROOT ms@2.0.0 OK for: debug@2.6.9 want: 2.0.0
156 timing idealTree:node_modules/debug Completed in 2ms
157 timing idealTree:node_modules/encodeurl Completed in 0ms
158 timing idealTree:node_modules/escape-html Completed in 0ms
159 timing idealTree:node_modules/finalhandler Completed in 0ms
160 timing idealTree:node_modules/fresh Completed in 0ms
161 timing idealTree:node_modules/merge-descriptors Completed in 0ms
162 timing idealTree:node_modules/methods Completed in 0ms
163 silly placeDep ROOT mime-db@1.46.0 OK for: mime-types@2.1.29 want: 1.46.0
164 timing idealTree:node_modules/mime-types Completed in 1ms
165 timing idealTree:node_modules/mime-db Completed in 0ms
166 timing idealTree:node_modules/ms Completed in 0ms
167 timing idealTree:node_modules/negotiator Completed in 0ms
168 silly placeDep ROOT ee-first@1.1.1 OK for: on-finished@2.3.0 want: 1.1.1
169 timing idealTree:node_modules/on-finished Completed in 1ms
170 timing idealTree:node_modules/ee-first Completed in 0ms
171 timing idealTree:node_modules/parseurl Completed in 0ms
172 timing idealTree:node_modules/path-to-regexp Completed in 0ms
173 silly placeDep ROOT forwarded@0.1.2 OK for: proxy-addr@2.0.6 want: ~0.1.2
174 silly placeDep ROOT ipaddr.js@1.9.1 OK for: proxy-addr@2.0.6 want: 1.9.1
175 timing idealTree:node_modules/proxy-addr Completed in 1ms
176 timing idealTree:node_modules/forwarded Completed in 0ms
177 timing idealTree:node_modules/ipaddr.js Completed in 0ms
178 timing idealTree:node_modules/qs Completed in 0ms
179 timing idealTree:node_modules/range-parser Completed in 0ms
180 silly placeDep ROOT destroy@1.0.4 OK for: send@0.17.1 want: ~1.0.4
181 silly placeDep ROOT mime@1.6.0 OK for: send@0.17.1 want: 1.6.0
182 silly placeDep node_modules/send ms@2.1.1 OK for: send@0.17.1 want: 2.1.1
183 timing idealTree:node_modules/send Completed in 4ms
184 timing idealTree:node_modules/destroy Completed in 0ms
185 timing idealTree:node_modules/mime Completed in 0ms
186 timing idealTree:node_modules/serve-static Completed in 0ms
187 silly placeDep ROOT media-typer@0.3.0 OK for: type-is@1.6.18 want: 0.3.0
188 timing idealTree:node_modules/type-is Completed in 1ms
189 timing idealTree:node_modules/media-typer Completed in 0ms
190 timing idealTree:node_modules/utils-merge Completed in 0ms
191 timing idealTree:node_modules/vary Completed in 0ms
192 silly placeDep node_modules/body-parser inherits@2.0.3 OK for: http-errors@1.7.2 want: 2.0.3
193 timing idealTree:node_modules/body-parser/node_modules/http-errors Completed in 10ms
194 timing idealTree:node_modules/body-parser/node_modules/inherits Completed in 0ms
195 timing idealTree:node_modules/body-parser/node_modules/raw-body Completed in 0ms
196 timing idealTree:node_modules/content-disposition/node_modules/safe-buffer Completed in 0ms
197 timing idealTree:node_modules/express/node_modules/array-flatten Completed in 0ms
198 timing idealTree:node_modules/express/node_modules/safe-buffer Completed in 0ms
199 timing idealTree:node_modules/send/node_modules/ms Completed in 0ms
200 timing idealTree:buildDeps Completed in 2168ms
201 timing idealTree:fixDepFlags Completed in 12ms
202 timing idealTree Completed in 2504ms
203 timing reify:loadTrees Completed in 2506ms
204 timing reify:diffTrees Completed in 11ms
205 silly reify moves {}
206 timing reify:retireShallow Completed in 0ms
207 timing reify:createSparse Completed in 0ms
208 timing reify:loadBundles Completed in 0ms
209 timing reify:unpack Completed in 0ms
210 timing reify:unretire Completed in 0ms
211 timing build:queue Completed in 0ms
212 timing build:deps Completed in 1ms
213 timing build Completed in 1ms
214 timing reify:build Completed in 1ms
215 timing reify:trash Completed in 0ms
216 timing command:install Completed in 2550ms
217 verbose stack TypeError: Cannot read property 'version' of undefined
217 verbose stack     at Arborist.[saveIdealTree] (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\reify.js:875:33)
217 verbose stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\reify.js:131:39
217 verbose stack     at async Arborist.reify (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\reify.js:127:5)
217 verbose stack     at async install (C:\Program Files\nodejs\node_modules\npm\lib\install.js:38:3)
218 verbose cwd D:\Coding\krabs-test
219 verbose Windows_NT 10.0.18363
220 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "krabs"
221 verbose node v12.19.0
222 verbose npm  v7.5.4
223 error Cannot read property 'version' of undefined
224 verbose exit 1
@micheleriva
Copy link
Owner

Hi @dayvista,
Could you please tell me which version of Node are you running?

@dayvista
Copy link
Author

I was running v12.19.0. Just updated to v14.16.0 and I'm still getting the error.

@dayvista
Copy link
Author

The install failed when using Git Bash and the VSCode terminal, but succeeded once I tried Windows Powershell (I'm running Windows 10 as my OS).

@micheleriva
Copy link
Owner

Ok @dayvista, good to know! I don't think this is something related to Krabs specifically.

Cheers!

@dayvista
Copy link
Author

This has never happened with another npm package before - I'm guessing it has to do with either permissions or how node/npm is configured on my computer/the individual terminal apps I use.

As an aside, wanted to mention that I got the README example up and running on a Heroku server. I'll be doing a test with a larger project in a couple weeks. Pleased with the library thus far.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants