2017-08-18 37 views
0

我試圖初始化firebase雲端函數和依賴項安裝總是失敗的部分。它始終顯示在啓動Firebase雲端函數時安裝npm依賴時出錯

  • npm ERR!代碼Z_BUF_ERROR
  • npm ERR! errno -5
  • npm ERR!文件

這裏意外結束 是我的package.json

{ 
"name": "functions", 
"description": "Cloud Functions for Firebase", 
"dependencies": { 
"firebase-admin": "~4.2.1", 
"firebase-functions": "^0.5.7" 
}, 
"private": true 
} 

下面是安裝過程中創建完整的日誌:

0 info it worked if it ends with ok 
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe', 
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js', 
1 verbose cli 'install' ] 
2 info using [email protected] 
3 info using [email protected] 
4 verbose npm-session 9486ab817502fd95 
5 silly install runPreinstallTopLevelLifecycles 
6 silly preinstall [email protected] 
7 info lifecycle [email protected]~preinstall: [email protected] 
8 silly install loadCurrentTree 
9 silly install readLocalPackageData 
10 silly install loadIdealTree 
11 silly install cloneCurrentTreeToIdealTree 
12 silly install loadShrinkwrap 
13 silly install loadAllDepsIntoIdealTree 
14 http fetch GET 304 https://registry.npmjs.org/firebase-functions 514ms (from cache) 
15 http fetch GET 304 https://registry.npmjs.org/firebase-admin 532ms (from cache) 
16 silly pacote range manifest for [email protected]^0.5.7 fetched in 524ms 
17 http fetch GET 200 https://registry.npmjs.org/firebase-admin/-/firebase-admin-4.2.1.tgz 41ms (from cache) 
18 silly fetchPackageMetaData error for [email protected]~4.2.1 unexpected end of file 
19 http fetch GET 304 https://registry.npmjs.org/lodash 292ms (from cache) 
20 http fetch GET 304 https://registry.npmjs.org/jsonwebtoken 299ms (from cache) 
21 http fetch GET 304 https://registry.npmjs.org/express 303ms (from cache) 
22 silly pacote range manifest for [email protected]^4.6.1 fetched in 307ms 
23 silly pacote range manifest for [email protected]^7.1.9 fetched in 309ms 
24 silly pacote range manifest for [email protected]^4.0.33 fetched in 318ms 
25 http fetch GET 304 https://registry.npmjs.org/joi 125ms (from cache) 
26 silly pacote range manifest for [email protected]^6.10.1 fetched in 143ms 
27 http fetch GET 304 https://registry.npmjs.org/sha1 454ms (from cache) 
28 silly pacote range manifest for [email protected]^1.1.1 fetched in 460ms 
29 http fetch GET 304 https://registry.npmjs.org/xtend 169ms (from cache) 
30 silly pacote range manifest for [email protected]^4.0.1 fetched in 174ms 
31 http fetch GET 304 https://registry.npmjs.org/ms 184ms (from cache) 
32 silly pacote range manifest for [email protected]^2.0.0 fetched in 188ms 
33 http fetch GET 304 https://registry.npmjs.org/accepts 73ms (from cache) 
34 silly pacote range manifest for [email protected]~1.3.3 fetched in 77ms 
35 http fetch GET 304 https://registry.npmjs.org/array-flatten 69ms (from cache) 
36 silly pacote version manifest for [email protected] fetched in 76ms 
37 http fetch GET 304 https://registry.npmjs.org/lodash.once 250ms (from cache) 
38 silly pacote range manifest for [email protected]^4.0.0 fetched in 254ms 
39 http fetch GET 304 https://registry.npmjs.org/content-disposition 85ms (from cache) 
40 silly pacote version manifest for [email protected] fetched in 89ms 
41 http fetch GET 304 https://registry.npmjs.org/content-type 83ms (from cache) 
42 silly pacote range manifest for [email protected]~1.0.2 fetched in 87ms 
43 http fetch GET 304 https://registry.npmjs.org/cookie 90ms (from cache) 
44 silly pacote version manifest for [email protected] fetched in 94ms 
45 http fetch GET 304 https://registry.npmjs.org/cookie-signature 104ms (from cache) 
46 silly pacote version manifest for [email protected] fetched in 111ms 
47 http fetch GET 304 https://registry.npmjs.org/debug 97ms (from cache) 
48 silly pacote version manifest for [email protected] fetched in 101ms 
49 http fetch GET 304 https://registry.npmjs.org/depd 89ms (from cache) 
50 silly pacote range manifest for [email protected]~1.1.1 fetched in 95ms 
51 http fetch GET 304 https://registry.npmjs.org/encodeurl 95ms (from cache) 
52 silly pacote range manifest for [email protected]~1.0.1 fetched in 99ms 
53 http fetch GET 304 https://registry.npmjs.org/escape-html 91ms (from cache) 
54 silly pacote range manifest for [email protected]~1.0.3 fetched in 94ms 
55 http fetch GET 304 https://registry.npmjs.org/etag 82ms (from cache) 
56 silly pacote range manifest for [email protected]~1.8.0 fetched in 86ms 
57 http fetch GET 304 https://registry.npmjs.org/finalhandler 88ms (from cache) 
58 silly pacote range manifest for [email protected]~1.0.4 fetched in 94ms 
59 http fetch GET 304 https://registry.npmjs.org/fresh 93ms (from cache) 
60 silly pacote version manifest for [email protected] fetched in 98ms 
61 http fetch GET 304 https://registry.npmjs.org/merge-descriptors 92ms (from cache) 
62 silly pacote version manifest for [email protected] fetched in 97ms 
63 http fetch GET 304 https://registry.npmjs.org/methods 92ms (from cache) 
64 silly pacote range manifest for [email protected]~1.1.2 fetched in 96ms 
65 http fetch GET 304 https://registry.npmjs.org/on-finished 90ms (from cache) 
66 silly pacote range manifest for [email protected]~2.3.0 fetched in 93ms 
67 http fetch GET 304 https://registry.npmjs.org/parseurl 91ms (from cache) 
68 silly pacote range manifest for [email protected]~1.3.1 fetched in 95ms 
69 http fetch GET 304 https://registry.npmjs.org/path-to-regexp 89ms (from cache) 
70 http fetch GET 304 https://registry.npmjs.org/@types%2fsha1 867ms (from cache) 
71 silly pacote range manifest for @types/[email protected]^1.1.0 fetched in 879ms 
72 silly pacote version manifest for [email protected] fetched in 104ms 
73 http fetch GET 304 https://registry.npmjs.org/proxy-addr 121ms (from cache) 
74 http fetch GET 304 https://registry.npmjs.org/@types%2flodash 912ms (from cache) 
75 silly pacote range manifest for [email protected]~1.1.5 fetched in 127ms 
76 silly pacote range manifest for @types/[email protected]^4.14.34 fetched in 920ms 
77 http fetch GET 304 https://registry.npmjs.org/qs 102ms (from cache) 
78 silly pacote version manifest for [email protected] fetched in 109ms 
79 http fetch GET 304 https://registry.npmjs.org/range-parser 98ms (from cache) 
80 silly pacote range manifest for [email protected]~1.2.0 fetched in 104ms 
81 http fetch GET 304 https://registry.npmjs.org/send 96ms (from cache) 
82 silly pacote version manifest for [email protected] fetched in 101ms 
83 http fetch GET 304 https://registry.npmjs.org/setprototypeof 87ms (from cache) 
84 http fetch GET 304 https://registry.npmjs.org/serve-static 88ms (from cache) 
85 silly pacote version manifest for [email protected] fetched in 93ms 
86 silly pacote version manifest for [email protected] fetched in 95ms 
87 http fetch GET 304 https://registry.npmjs.org/statuses 94ms (from cache) 
88 silly pacote range manifest for [email protected]~1.3.1 fetched in 101ms 
89 http fetch GET 304 https://registry.npmjs.org/type-is 97ms (from cache) 
90 http fetch GET 304 https://registry.npmjs.org/utils-merge 98ms (from cache) 
91 silly pacote range manifest for [email protected]~1.6.15 fetched in 108ms 
92 http fetch GET 304 https://registry.npmjs.org/vary 95ms (from cache) 
93 http fetch GET 304 https://registry.npmjs.org/@types%2fexpress 1036ms (from cache) 
94 http fetch GET 200 https://registry.npmjs.org/@types%2fjsonwebtoken 1038ms 
95 silly pacote version manifest for [email protected] fetched in 110ms 
96 silly pacote range manifest for [email protected]~1.1.1 fetched in 104ms 
97 silly pacote range manifest for @types/[email protected]^7.1.32 fetched in 1046ms 
98 silly pacote range manifest for @types/[email protected]^4.0.33 fetched in 1052ms 
99 silly pacote version manifest for [email protected] fetched in 16ms 
100 http fetch GET 304 https://registry.npmjs.org/hoek 107ms (from cache) 
101 http fetch GET 304 https://registry.npmjs.org/topo 108ms (from cache) 
102 silly pacote range manifest for [email protected] fetched in 124ms 
103 silly pacote range manifest for [email protected] fetched in 113ms 
104 http fetch GET 304 https://registry.npmjs.org/isemail 114ms (from cache) 
105 silly pacote range manifest for [email protected] fetched in 129ms 
106 http fetch GET 304 https://registry.npmjs.org/moment 125ms (from cache) 
107 http fetch GET 304 https://registry.npmjs.org/charenc 121ms (from cache) 
108 silly pacote range manifest for [email protected] fetched in 133ms 
109 http fetch GET 304 https://registry.npmjs.org/jws 843ms (from cache) 
110 silly pacote range manifest for [email protected]>= 0.0.1 fetched in 131ms 
111 silly pacote range manifest for [email protected]^3.1.4 fetched in 850ms 
112 http fetch GET 304 https://registry.npmjs.org/mime-types 122ms (from cache) 
113 http fetch GET 304 https://registry.npmjs.org/negotiator 122ms (from cache) 
114 http fetch GET 304 https://registry.npmjs.org/crypt 129ms (from cache) 
115 silly pacote version manifest for [email protected] fetched in 130ms 
116 silly pacote range manifest for [email protected]~2.1.11 fetched in 132ms 
117 silly pacote range manifest for [email protected]>= 0.0.1 fetched in 139ms 
118 silly pacote range manifest for [email protected]~2.1.15 fetched in 7ms 
119 http fetch GET 304 https://registry.npmjs.org/unpipe 130ms (from cache) 
120 silly pacote range manifest for [email protected]~1.0.0 fetched in 135ms 
121 http fetch GET 304 https://registry.npmjs.org/ee-first 116ms (from cache) 
122 silly pacote version manifest for [email protected] fetched in 120ms 
123 http fetch GET 304 https://registry.npmjs.org/forwarded 130ms (from cache) 
124 silly pacote range manifest for [email protected]~0.1.0 fetched in 133ms 
125 http fetch GET 304 https://registry.npmjs.org/ipaddr.js 138ms (from cache) 
126 silly pacote version manifest for [email protected] fetched in 142ms 
127 http fetch GET 304 https://registry.npmjs.org/destroy 152ms (from cache) 
128 silly pacote range manifest for [email protected]~1.0.4 fetched in 159ms 
129 http fetch GET 304 https://registry.npmjs.org/http-errors 156ms (from cache) 
130 http fetch GET 304 https://registry.npmjs.org/mime 149ms (from cache) 
131 silly pacote range manifest for [email protected]~1.6.2 fetched in 162ms 
132 http fetch GET 304 https://registry.npmjs.org/media-typer 152ms (from cache) 
133 silly pacote version manifest for [email protected] fetched in 156ms 
134 silly pacote version manifest for [email protected] fetched in 6ms 
135 silly pacote version manifest for [email protected] fetched in 160ms 
136 silly pacote range manifest for [email protected]>= 1.3.1 < 2 fetched in 3ms 
137 http fetch GET 304 https://registry.npmjs.org/safe-buffer 157ms (from cache) 
138 silly pacote range manifest for [email protected]^5.0.1 fetched in 168ms 
139 http fetch GET 304 https://registry.npmjs.org/inherits 141ms (from cache) 
140 http fetch GET 304 https://registry.npmjs.org/mime-db 154ms (from cache) 
141 silly pacote version manifest for [email protected] fetched in 145ms 
142 silly pacote range manifest for [email protected]~1.29.0 fetched in 159ms 
143 http fetch GET 304 https://registry.npmjs.org/jwa 280ms (from cache) 
144 silly pacote range manifest for [email protected]^1.1.4 fetched in 284ms 
145 http fetch GET 304 https://registry.npmjs.org/ecdsa-sig-formatter 164ms (from cache) 
146 silly pacote version manifest for [email protected] fetched in 169ms 
147 http fetch GET 304 https://registry.npmjs.org/buffer-equal-constant-time 256ms (from cache) 
148 silly pacote version manifest for [email protected] fetched in 261ms 
149 http fetch GET 304 https://registry.npmjs.org/@types%2fnode 839ms (from cache) 
150 silly pacote range manifest for @types/[email protected]* fetched in 848ms 
151 http fetch GET 304 https://registry.npmjs.org/base64url 884ms (from cache) 
152 http fetch GET 304 https://registry.npmjs.org/base64url 571ms (from cache) 
153 http fetch GET 304 https://registry.npmjs.org/@types%2fserve-static 914ms (from cache) 
154 http fetch GET 304 https://registry.npmjs.org/@types%2fexpress-serve-static-core 901ms (from cache) 
155 silly pacote range manifest for [email protected]^2.0.0 fetched in 894ms 
156 silly pacote version manifest for [email protected] fetched in 580ms 
157 silly pacote range manifest for @types/[email protected]* fetched in 918ms 
158 silly pacote range manifest for @types/[email protected]* fetched in 905ms 
159 http fetch GET 304 https://registry.npmjs.org/@types%2fmime 908ms (from cache) 
160 silly pacote range manifest for @types/[email protected]* fetched in 919ms 
161 silly pacote range manifest for [email protected]^0.5.7 fetched in 13ms 
162 silly resolveWithNewModule [email protected] checking installable status 
163 http fetch GET 200 https://registry.npmjs.org/firebase-admin/-/firebase-admin-4.2.1.tgz 18ms (from cache) 
164 silly fetchPackageMetaData error for [email protected]~4.2.1 unexpected end of file 
165 verbose stack Error: unexpected end of file 
165 verbose stack  at Gunzip.zlibOnError (zlib.js:152:15) 
166 verbose cwd C:\Users\eugene.m.aquilino\pal-poc\functions 
167 verbose Windows_NT 10.0.14393 
168 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" 
169 verbose node v8.3.0 
170 verbose npm v5.3.0 
171 error code Z_BUF_ERROR 
172 error errno -5 
173 error unexpected end of file 
174 verbose exit [ -5, true ] 

有人能幫助我找到錯誤?謝謝!

+0

你嘗試運行'NPM緩存clean',然後重新運行你的'NPM安裝...'? – mscdex

+0

@mscdex非常感謝你:)那個工作,再次感謝你 –

回答

0

有時(tarball)的下載可能會被破壞,當他們這樣做時,你通常會得到某種與zlib有關的錯誤。發生這種情況時,第一步是運行npm cache clean刪除任何可能截斷的下載,然後重新嘗試npm install ...