我经常在安装各种节点包时遇到错误。发生错误后,您会收到一条消息Additonal logging details can be found in:
&它指向npm-debug.log
文件。
我已经浏览过这个文件,发现很难理解错误。如何从日志文件中获取精确的错误详细信息。
我在运行npm install yeoman
命令时遇到错误。我知道这个错误不是特定于这个yeoman模块。
我减少了日志文件的大小,因为SO只允许在邮件正文中有30000个字符!
我正在查看我的日志文件:
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',
1 verbose cli 'yeoman' ]
2 info using npm@1.4.3
3 info using node@v0.10.26
4 verbose node symlink C:\Program Files\nodejs\\node.exe
5 verbose cache add [ 'yeoman', null ]
6 verbose cache add name=undefined spec="yeoman" args=["yeoman",null]
7 verbose parsed url { protocol: null,
7 verbose parsed url slashes: null,
7 verbose parsed url auth: null,
7 verbose parsed url host: null,
7 verbose parsed url port: null,
7 verbose parsed url hostname: null,
7 verbose parsed url hash: null,
7 verbose parsed url search: null,
7 verbose parsed url query: null,
7 verbose parsed url pathname: 'yeoman',
7 verbose parsed url path: 'yeoman',
7 verbose parsed url href: 'yeoman' }
8 silly lockFile 6b23522e-yeoman yeoman
9 verbose lock yeoman C:\Users\jay\AppData\Roaming\npm-cache\6b23522e-yeoman.lock
10 silly lockFile 6b23522e-yeoman yeoman
11 silly lockFile 6b23522e-yeoman yeoman
12 verbose addNamed [ 'yeoman', '' ]
13 verbose addNamed [ null, '*' ]
14 silly lockFile 70747b36-yeoman yeoman@
15 verbose lock yeoman@ C:\Users\jay\AppData\Roaming\npm-cache\70747b36-yeoman.lock
16 silly addNameRange { name: 'yeoman', range: '*', hasData: false }
17 verbose url raw yeoman
18 verbose url resolving [ 'https://registry.npmjs.org/', './yeoman' ]
19 verbose url resolved https://registry.npmjs.org/yeoman
20 info trying registry request attempt 1 at 15:57:55
21 verbose etag "5PEGRPZX0J3OYMK10MW6KSGFM"
22 http GET https://registry.npmjs.org/yeoman
23 http 304 https://registry.npmjs.org/yeoman
24 silly registry.get cb [ 304,
24 silly registry.get { date: 'Fri, 22 May 2015 10:27:56 GMT',
24 silly registry.get via: '1.1 varnish',
24 silly registry.get 'cache-control': 'max-age=60',
24 silly registry.get etag: '"5PEGRPZX0J3OYMK10MW6KSGFM"',
24 silly registry.get age: '46',
24 silly registry.get connection: 'keep-alive',
24 silly registry.get 'x-served-by': 'cache-sin6922-SIN',
24 silly registry.get 'x-cache': 'HIT',
24 silly registry.get 'x-cache-hits': '1',
24 silly registry.get 'x-timer': 'S1432290476.164280,VS0,VE0',
24 silly registry.get vary: 'Accept' } ]
25 verbose etag yeoman from cache
26 silly addNameRange number 2 { name: 'yeoman', range: '*', hasData: true }
27 silly addNameRange versions [ 'yeoman', [ '0.9.6' ] ]
28 verbose addNamed [ 'yeoman', '0.9.6' ]
29 verbose addNamed [ '0.9.6', '0.9.6' ]
30 silly lockFile 72540a0c-yeoman-0-9-6 yeoman@0.9.6
31 verbose lock yeoman@0.9.6 C:\Users\jay\AppData\Roaming\npm-cache\72540a0c-yeoman-0-9-6.lock
32 warn deprecated yeoman@0.9.6: The Yeoman CLI is deprecated. See http://yeoman.io/migrate.html for more info.
33 silly lockFile 72540a0c-yeoman-0-9-6 yeoman@0.9.6
34 silly lockFile 72540a0c-yeoman-0-9-6 yeoman@0.9.6
35 silly lockFile 70747b36-yeoman yeoman@
36 silly lockFile 70747b36-yeoman yeoman@
37 silly resolved [ { name: 'yeoman',
37 silly resolved version: '0.9.6',
37 silly resolved description: 'The Yeoman CLI is deprecated. See http://yeoman.io/migrate.html for more info.',
37 silly resolved keywords:
37 silly resolved [ 'front-end',
37 silly resolved 'development',
37 silly resolved 'dev',
37 silly resolved 'build',
37 silly resolved 'web',
37 silly resolved 'tool',
37 silly resolved 'cli',
37 silly resolved 'scaffold',
37 silly resolved 'stack' ],
37 silly resolved homepage: 'http://yeoman.io',
37 silly resolved bugs: { url: 'https://github.com/yeoman/yeoman/issues' },
37 silly resolved author: { name: 'Chrome Developer Relations' },
37 silly resolved main: './yeoman',
37 silly resolved bin:
37 silly resolved { yeoman: './bin/yeoman',
37 silly resolved _yeomaninsight: './bin/yeomaninsight.py' },
37 silly resolved directories: { man: './man' },
1282 verbose parsed url host: null,
1282 verbose parsed url port: null,
1282 verbose parsed url hostname: null,
1282 verbose parsed url hash: null,
1282 verbose parsed url search: null,
1282 verbose parsed url query: null,
1282 verbose parsed url pathname: '~0.1.12',
1282 verbose parsed url path: '~0.1.12',
1282 verbose parsed url href: '~0.1.12' }
1283 verbose addNamed [ 'prompt', '~0.1.12' ]
1284 verbose addNamed [ null, '>=0.1.12-0 <0.2.0-0' ]
1285 silly lockFile 39e4a135-prompt-0-1-12 prompt@~0.1.12
1286 verbose lock prompt@~0.1.12 C:\Users\jay\AppData\Roaming\npm-cache\39e4a135-prompt-0-1-12.lock
1287 verbose cache add [ 'colors@~0.6.0', null ]
1288 verbose cache add name=undefined spec="colors@~0.6.0" args=["colors@~0.6.0",null]
1289 verbose parsed url { protocol: null,
1289 verbose parsed url slashes: null,
1289 verbose parsed url auth: null,
1289 verbose parsed url host: null,
1289 verbose parsed url port: null,
1298 verbose parsed url pathname: 'grunt-mocha@~0.1.3',
1298 verbose parsed url path: 'grunt-mocha@~0.1.3',
1298 verbose parsed url href: 'grunt-mocha@~0.1.3' }
1299 verbose cache add name="grunt-mocha" spec="~0.1.3" args=["grunt-mocha","~0.1.3"]
1300 verbose parsed url { protocol: null,
1300 verbose parsed url slashes: null,
1300 verbose parsed url auth: null,
1300 verbose parsed url host: null,
1300 verbose parsed url port: null,
1300 verbose parsed url hostname: null,
1300 verbose parsed url hash: null,
1300 verbose parsed url search: null,
1300 verbose parsed url query: null,
1300 verbose parsed url pathname: '~0.1.3',
1300 verbose parsed url path: '~0.1.3',
1300 verbose parsed url href: '~0.1.3' }
1301 verbose addNamed [ 'grunt-mocha', '~0.1.3' ]
1302 verbose addNamed [ null, '>=0.1.3-0 <0.2.0-0' ]
1303 silly lockFile 0b644ca0-grunt-mocha-0-1-3 grunt-mocha@~0.1.3
1304 verbose lock grunt-mocha@~0.1.3 C:\Users\jay\AppData\Roaming\npm-cache\0b644ca0-grunt-mocha-0-1-3.lock
1305 verbose cache add [ 'es6-collections@>=0.2.0', null ]
1313 verbose lock es6-collections@>=0.2.0 C:\Users\jay\AppData\Roaming\npm-cache\e426cb81-es6-collections-0-2-0.lock
1314 verbose cache add [ 'grunt-contrib-coffee@~0.3.1', null ]
1315 verbose cache add name=undefined spec="grunt-contrib-coffee@~0.3.1" args=["grunt-contrib-coffee@~0.3.1",null]
1316 verbose parsed url { protocol: null,
1316 verbose parsed url slashes: null,
1316 verbose parsed url auth: null,
1316 verbose parsed url host: null,
1316 verbose parsed url port: null,
1316 verbose parsed url hostname: null,
1316 verbose parsed url hash: null,
1316 verbose parsed url search: null,
1316 verbose parsed url query: null,
1316 verbose parsed url pathname: 'grunt-contrib-coffee@~0.3.1',
1316 verbose parsed url path: 'grunt-contrib-coffee@~0.3.1',
1316 verbose parsed url href: 'grunt-contrib-coffee@~0.3.1' }
1317 verbose cache add name="grunt-contrib-coffee" spec="~0.3.1" args=["grunt-contrib-coffee","~0.3.1"]
1318 verbose parsed url { protocol: null,
1318 verbose parsed url slashes: null,
1318 verbose parsed url auth: null,
1318 verbose parsed url host: null,
1318 verbose parsed url port: null,
1318 verbose parsed url hostname: null,
1318 verbose parsed url hash: null,
1318 verbose parsed url search: null,
1318 verbose parsed url query: null,
1318 verbose parsed url pathname: '~0.3.1',
1318 verbose parsed url path: '~0.3.1',
1318 verbose parsed url href: '~0.3.1' }
1319 verbose addNamed [ 'grunt-contrib-coffee', '~0.3.1' ]
1320 verbose addNamed [ null, '>=0.3.1-0 <0.4.0-0' ]
1321 silly lockFile fc10f0e7-grunt-contrib-coffee-0-3-1 grunt-contrib-coffee@~0.3.1
1322 verbose lock grunt-contrib-coffee@~0.3.1 C:\Users\jay\AppData\Roaming\npm-cache\fc10f0e7-grunt-contrib-coffee-0-3-1.lock
1323 verbose url raw request
1324 verbose url resolving [ 'https://registry.npmjs.org/', './request' ]
1325 verbose url resolved https://registry.npmjs.org/request
1326 info trying registry request attempt 1 at 15:57:57
1327 verbose etag "6JZNPLSQFV602NZR04IK4AED4"
1328 http GET https://registry.npmjs.org/request
1329 verbose url raw cheerio
1330 verbose url resolving [ 'https://registry.npmjs.org/', './cheerio' ]
1331 verbose url resolved https://registry.npmjs.org/cheerio
1332 info trying registry request attempt 1 at 15:57:57
1333 verbose etag "8OQ5GREHEQT1GF01UC1U0686T"
1334 http GET https://registry.npmjs.org/cheerio
1335 verbose url raw which
1336 verbose url resolving [ 'https://registry.npmjs.org/', './which' ]
1337 verbose url resolved https://registry.npmjs.org/which
1338 info trying registry request attempt 1 at 15:57:57
1339 verbose etag "96S32KNGR7RC2G6UDCTQWOHI9"
1340 http GET https://registry.npmjs.org/which
1341 verbose url raw requirejs
1342 verbose url resolving [ 'https://registry.npmjs.org/', './requirejs' ]
1343 verbose url resolved https://registry.npmjs.org/requirejs
1344 info trying registry request attempt 1 at 15:57:57
1345 verbose etag "ENZYCLLVXA09XRT3C9DQC0L0W"
1346 http GET https://registry.npmjs.org/requirejs
1347 verbose url raw connect
1348 verbose url resolving [ 'https://registry.npmjs.org/', './connect' ]
1349 verbose url resolved https://registry.npmjs.org/connect
1350 info trying registry request attempt 1 at 15:57:57
1351 verbose etag "8KJZ483FTEDN2ODI7TCELL9ZF"
1352 http GET https://registry.npmjs.org/connect
1353 http GET http://github.com/yeoman/generators/archive/0.9.5.tar.gz
1354 silly addNameRange { name: 'coffee-script',
1354 silly addNameRange range: '>=1.3.3-0 <1.4.0-0',
1354 silly addNameRange hasData: false }
1355 http GET http://github.com/cowboy/grunt/archive/0ba6d4b529.tar.gz
1356 silly addNameRange { name: 'grunt-jasmine-task',
1356 silly addNameRange range: '>=0.2.2-0 <0.3.0-0',
1356 silly addNameRange hasData: false }
1357 silly addNameRange { name: 'fstream', range: '>=0.1.18-0 <0.2.0-0', hasData: false }
1358 silly addNameRange { name: 'tar', range: '>=0.1.13-0 <0.2.0-0', hasData: false }
1359 silly addNameRange { name: 'shelljs', range: '>=0.0.6-0 <0.1.0-0', hasData: false }
1360 silly addNameRange { name: 'faye-websocket',
1360 silly addNameRange range: '>=0.4.2-0 <0.5.0-0',
1360 silly addNameRange hasData: false }
1361 silly addNameRange { name: 'colors', range: '>=0.6.0-0 <0.7.0-0', hasData: false }
1362 silly addNameRange { name: 'grunt-mocha',
1362 silly addNameRange range: '>=0.1.3-0 <0.2.0-0',
1362 silly addNameRange hasData: false }
1363 silly addNameRange { name: 'es6-collections', range: '>=0.2.0', hasData: false }
1364 silly addNameRange { name: 'prompt', range: '>=0.1.12-0 <0.2.0-0', hasData: false }
1365 silly addNameRange { name: 'grunt-contrib-coffee',
1365 silly addNameRange range: '>=0.3.1-0 <0.4.0-0',
1365 silly addNameRange hasData: false }
1366 verbose url raw html-minifier
1367 verbose url resolving [ 'https://registry.npmjs.org/', './html-minifier' ]
1368 verbose url resolved https://registry.npmjs.org/html-minifier
1369 info trying registry request attempt 1 at 15:57:57
1370 verbose etag "26T0GX9YP3BJ3JDKRY94MZ5A6"
1371 http GET https://registry.npmjs.org/html-minifier
1372 verbose url raw coffee-script
1373 verbose url resolving [ 'https://registry.npmjs.org/', './coffee-script' ]
1374 verbose url resolved https://registry.npmjs.org/coffee-script
1375 info trying registry request attempt 1 at 15:57:57
1376 verbose etag "3NSRDBLJB4J48EQLR1C2CFBI5"
1377 http GET https://registry.npmjs.org/coffee-script
1378 verbose url raw grunt-jasmine-task
1379 verbose url resolving [ 'https://registry.npmjs.org/', './grunt-jasmine-task' ]
1380 verbose url resolved https://registry.npmjs.org/grunt-jasmine-task
1381 info trying registry request attempt 1 at 15:57:57
1382 verbose etag "32KWCK4W11BL0WT9ZK05WLWWK"
1383 http GET https://registry.npmjs.org/grunt-jasmine-task
1384 verbose url raw fstream
1385 verbose url resolving [ 'https://registry.npmjs.org/', './fstream' ]
1386 verbose url resolved https://registry.npmjs.org/fstream
1387 info trying registry request attempt 1 at 15:57:57
1388 verbose etag "7UK90900RO4QVKSB9M0HMNJJW"
1389 http GET https://registry.npmjs.org/fstream
1390 verbose url raw tar
1391 verbose url resolving [ 'https://registry.npmjs.org/', './tar' ]
1392 verbose url resolved https://registry.npmjs.org/tar
1393 info trying registry request attempt 1 at 15:57:58
1394 verbose etag "5WELXMBX7NWXCK2BAC2LJWPU"
1395 http GET https://registry.npmjs.org/tar
1396 verbose url raw fstream-ignore/0.0.5
1397 verbose url resolving [ 'https://registry.npmjs.org/', './fstream-ignore/0.0.5' ]
1398 verbose url resolved https://registry.npmjs.org/fstream-ignore/0.0.5
1399 info trying registry request attempt 1 at 15:57:58
1400 verbose etag "6O8QJ7N393JC7QUG8NS4M73WG"
1401 http GET https://registry.npmjs.org/fstream-ignore/0.0.5
1402 verbose url raw prompt
1403 verbose url resolving [ 'https://registry.npmjs.org/', './prompt' ]
1404 verbose url resolved https://registry.npmjs.org/prompt
1405 info trying registry request attempt 1 at 15:57:58
1406 verbose etag "5JDMFW9V44OJ3X465FEMAZWRE"
1407 http GET https://registry.npmjs.org/prompt
1408 verbose url raw es6-collections
1409 verbose url resolving [ 'https://registry.npmjs.org/', './es6-collections' ]
1410 verbose url resolved https://registry.npmjs.org/es6-collections
1411 info trying registry request attempt 1 at 15:57:58
1412 verbose etag "BAWNBNZAM8Q9IJHWO5RR04QFS"
1413 http GET https://registry.npmjs.org/es6-collections
1414 verbose url raw shelljs
1415 verbose url resolving [ 'https://registry.npmjs.org/', './shelljs' ]
1416 verbose url resolved https://registry.npmjs.org/shelljs
1417 info trying registry request attempt 1 at 15:57:58
1418 verbose etag "24HQG9B78S14UI9CPL9I6DEFO"
1419 http GET https://registry.npmjs.org/shelljs
1420 verbose url raw grunt-contrib-coffee
1421 verbose url resolving [ 'https://registry.npmjs.org/', './grunt-contrib-coffee' ]
1422 verbose url resolved https://registry.npmjs.org/grunt-contrib-coffee
1423 info trying registry request attempt 1 at 15:57:58
1424 verbose etag "675PIC8E5G4HL0OGICQ7TYBNL"
1425 http GET https://registry.npmjs.org/grunt-contrib-coffee
1426 verbose url raw faye-websocket
1427 verbose url resolving [ 'https://registry.npmjs.org/', './faye-websocket' ]
1428 verbose url resolved https://registry.npmjs.org/faye-websocket
1429 info trying registry request attempt 1 at 15:57:58
1430 verbose etag "FO4K1W15VDQVT34WDETEROF5"
1431 http GET https://registry.npmjs.org/faye-websocket
1432 verbose url raw colors
1433 verbose url resolving [ 'https://registry.npmjs.org/', './colors' ]
1434 verbose url resolved https://registry.npmjs.org/colors
1435 info trying registry request attempt 1 at 15:57:58
1436 verbose etag "455U5TEI7R0W3RPXNOGREZ6FP"
1437 http GET https://registry.npmjs.org/colors
1438 verbose url raw grunt-mocha
1439 verbose url resolving [ 'https://registry.npmjs.org/', './grunt-mocha' ]
1440 verbose url resolved https://registry.npmjs.org/grunt-mocha
1441 info trying registry request attempt 1 at 15:57:58
1442 verbose etag "DVGJW6H7D8TZZA6PM09U5JXKB"
1443 http GET https://registry.npmjs.org/grunt-mocha
1444 http 403 http://github.com/yeoman/generators/archive/0.9.5.tar.gz
1445 http 403 http://github.com/cowboy/grunt/archive/0ba6d4b529.tar.gz
1446 error fetch failed http://github.com/cowboy/grunt/archive/0ba6d4b529.tar.gz
1447 silly lockFile f287ea7e--grunt-archive-0ba6d4b529-tar-gz http://github.com/cowboy/grunt/archive/0ba6d4b529.tar.gz
1448 silly lockFile f287ea7e--grunt-archive-0ba6d4b529-tar-gz http://github.com/cowboy/grunt/archive/0ba6d4b529.tar.gz
1449 error fetch failed http://github.com/yeoman/generators/archive/0.9.5.tar.gz
1450 silly lockFile 39a440c4--generators-archive-0-9-5-tar-gz http://github.com/yeoman/generators/archive/0.9.5.tar.gz
1451 silly lockFile 39a440c4--generators-archive-0-9-5-tar-gz http://github.com/yeoman/generators/archive/0.9.5.tar.gz
1452 verbose about to build C:\temp\node_modules\yeoman
1453 info C:\temp\node_modules\yeoman unbuild
1454 info preuninstall yeoman@0.9.6
1455 info uninstall yeoman@0.9.6
1456 verbose true,C:\temp\node_modules,C:\temp\node_modules unbuild yeoman@0.9.6
1457 verbose C:\temp\node_modules\.bin,[object Object] binRoot
1458 info postuninstall yeoman@0.9.6
1459 error Error: 403 Forbidden
1459 error at WriteStream.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\fetch.js:57:12)
1459 error at WriteStream.EventEmitter.emit (events.js:117:20)
1459 error at fs.js:1598:14
1459 error at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:105:5
1459 error at Object.oncomplete (fs.js:107:15)
1460 error If you need help, you may report this *entire* log,
1460 error including the npm and node versions, at:
1460 error <http://github.com/npm/npm/issues>
1461 error System Windows_NT 6.1.7601
1462 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "yeoman"
1463 error cwd C:\temp\abc
1464 error node -v v0.10.26
1465 error npm -v 1.4.3
1466 verbose exit [ 1, true ]
答案 0 :(得分:0)
您可以看到您的机器正在运行此命令:
1462 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "yeoman"
然后,您可以看到跟踪:
1459 error Error: 403 Forbidden
1459 error at WriteStream.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\fetch.js:57:12)
1459 error at WriteStream.EventEmitter.emit (events.js:117:20)
1459 error at fs.js:1598:14
1459 error at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:105:5
1459 error at Object.oncomplete (fs.js:107:15)
这里发生了什么?好吧,我不知道npm内部,但假设fetch
组件打开连接到服务器的套接字是公平的。该服务器返回错误代码403 Forbidden
。因此,npm阻止您访问,或者您的代理阻止了您,或者其他任何可以篡改服务器请求的人。
FWIW,yeoman
软件包已在2年前弃用。您应该在官方网站上获取最新信息:http://yeoman.io