使用NPM安装Karma的问题

时间:2014-02-28 01:07:20

标签: angularjs npm karma-runner

尝试使用节点v0.10.13和npm 1.3.2安装Karma。尝试使用和不使用sudo。这是日志:

npm http GET https://registry.npmjs.org/karma
npm http GET https://registry.npmjs.org/karma
npm http GET https://registry.npmjs.org/karma
npm http GET https://registry.npmjs.org/di
npm http GET https://registry.npmjs.org/chokidar
npm http GET https://registry.npmjs.org/glob
npm http GET https://registry.npmjs.org/socket.io
npm http GET https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/http-proxy
npm http GET https://registry.npmjs.org/optimist
npm http GET https://registry.npmjs.org/coffee-script
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/q
npm http GET https://registry.npmjs.org/colors/0.6.0-1
npm http GET https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/mime
npm http GET https://registry.npmjs.org/log4js
npm http GET https://registry.npmjs.org/useragent
npm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/connect
npm http 304 https://registry.npmjs.org/minimatch
npm http 304 https://registry.npmjs.org/socket.io
npm http 304 https://registry.npmjs.org/rimraf
npm http 304 https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/lodash
npm http 304 https://registry.npmjs.org/useragent
npm http 304 https://registry.npmjs.org/log4js
npm http 304 https://registry.npmjs.org/q
npm http 304 https://registry.npmjs.org/graceful-fs
npm http 304 https://registry.npmjs.org/connect
npm http GET https://registry.npmjs.org/di
npm http GET https://registry.npmjs.org/chokidar
npm http GET https://registry.npmjs.org/glob
npm http GET https://registry.npmjs.org/http-proxy
npm http GET https://registry.npmjs.org/optimist
npm http GET https://registry.npmjs.org/coffee-script
npm http GET https://registry.npmjs.org/colors/0.6.0-1
npm http 304 https://registry.npmjs.org/http-proxy
npm http 304 https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/coffee-script
npm http 304 https://registry.npmjs.org/colors/0.6.0-1
npm http GET https://registry.npmjs.org/colors/-/colors-0.6.0-1.tgz
npm ERR! fetch failed https://registry.npmjs.org/colors/-/colors-0.6.0-1.tgz
npm http GET https://registry.npmjs.org/colors/-/colors-0.6.0-1.tgz
npm http 200 https://registry.npmjs.org/colors/-/colors-0.6.0-1.tgz
npm http GET https://registry.npmjs.org/glob
npm http GET https://registry.npmjs.org/di
npm http GET https://registry.npmjs.org/chokidar
npm http 304 https://registry.npmjs.org/glob
npm http 304 https://registry.npmjs.org/chokidar

> chokidar@0.8.1 postinstall /usr/local/share/npm/lib/node_modules/karma/node_modules/chokidar
> node setup-deps.js

Executing npm install fsevents@0.1.6 recursive-readdir@0.0.2
npm http GET https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/sigmund
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/wordwrap
npm http GET https://registry.npmjs.org/socket.io-client/0.9.16
npm http GET https://registry.npmjs.org/policyfile/0.0.4
npm http GET https://registry.npmjs.org/redis/0.7.3
npm http GET https://registry.npmjs.org/base64id/0.1.0
npm http 304 https://registry.npmjs.org/sigmund
npm http 304 https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/async/0.1.15
npm http GET https://registry.npmjs.org/readable-stream
npm http GET https://registry.npmjs.org/semver
npm http GET https://registry.npmjs.org/utile
npm http GET https://registry.npmjs.org/optimist
npm http GET https://registry.npmjs.org/pkginfo
npm http 304 https://registry.npmjs.org/socket.io-client/0.9.16
npm http 304 https://registry.npmjs.org/base64id/0.1.0
npm http 304 https://registry.npmjs.org/policyfile/0.0.4
npm http GET https://registry.npmjs.org/socket.io-client/-/socket.io-client-0.9.16.tgz
npm http GET https://registry.npmjs.org/qs/0.6.5
npm http GET https://registry.npmjs.org/formidable/1.0.14
npm http GET https://registry.npmjs.org/cookie-signature/1.0.1
npm http GET https://registry.npmjs.org/buffer-crc32/0.2.1
npm http GET https://registry.npmjs.org/cookie/0.1.0
npm http GET https://registry.npmjs.org/send/0.1.4
npm http GET https://registry.npmjs.org/base64id/-/base64id-0.1.0.tgz
npm http GET https://registry.npmjs.org/policyfile/-/policyfile-0.0.4.tgz
npm http GET https://registry.npmjs.org/bytes/0.2.0
npm http GET https://registry.npmjs.org/fresh/0.2.0
npm http GET https://registry.npmjs.org/pause/0.0.1
npm http GET https://registry.npmjs.org/uid2/0.0.2
npm http GET https://registry.npmjs.org/methods/0.0.1
npm http GET https://registry.npmjs.org/debug
npm http GET https://registry.npmjs.org/lru-cache
npm http 200 https://registry.npmjs.org/socket.io-client/-/socket.io-client-0.9.16.tgz
npm http 200 https://registry.npmjs.org/base64id/-/base64id-0.1.0.tgz
npm http 200 https://registry.npmjs.org/policyfile/-/policyfile-0.0.4.tgz
npm http 304 https://registry.npmjs.org/semver
npm http 304 https://registry.npmjs.org/utile
npm http 304 https://registry.npmjs.org/optimist
npm http GET https://registry.npmjs.org/utile/-/utile-0.2.1.tgz
npm http 304 https://registry.npmjs.org/async/0.1.15
npm http GET https://registry.npmjs.org/async/-/async-0.1.15.tgz
npm http 304 https://registry.npmjs.org/readable-stream
npm http 200 https://registry.npmjs.org/utile/-/utile-0.2.1.tgz
npm http 200 https://registry.npmjs.org/async/-/async-0.1.15.tgz
npm http 304 https://registry.npmjs.org/pkginfo
npm http 304 https://registry.npmjs.org/qs/0.6.5
npm http 304 https://registry.npmjs.org/cookie-signature/1.0.1
npm http GET https://registry.npmjs.org/qs/-/qs-0.6.5.tgz
npm http GET https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.1.tgz
npm http 304 https://registry.npmjs.org/formidable/1.0.14
npm http GET https://registry.npmjs.org/formidable/-/formidable-1.0.14.tgz
npm http 304 https://registry.npmjs.org/buffer-crc32/0.2.1
npm http GET https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.1.tgz
npm http 200 https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.1.tgz
npm ERR! fetch failed https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.1.tgz
npm http 200 https://registry.npmjs.org/qs/-/qs-0.6.5.tgz
npm http 200 https://registry.npmjs.org/formidable/-/formidable-1.0.14.tgz
npm http 304 https://registry.npmjs.org/cookie/0.1.0
npm http 304 https://registry.npmjs.org/send/0.1.4
npm http 304 https://registry.npmjs.org/bytes/0.2.0
npm http GET https://registry.npmjs.org/cookie/-/cookie-0.1.0.tgz
npm http GET https://registry.npmjs.org/send/-/send-0.1.4.tgz
npm http GET https://registry.npmjs.org/bytes/-/bytes-0.2.0.tgz
npm http 304 https://registry.npmjs.org/pause/0.0.1
npm http 304 https://registry.npmjs.org/fresh/0.2.0
npm http GET https://registry.npmjs.org/pause/-/pause-0.0.1.tgz
npm http GET https://registry.npmjs.org/fresh/-/fresh-0.2.0.tgz
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/deep-equal
npm http GET https://registry.npmjs.org/i
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/ncp
npm ERR! fetch failed https://registry.npmjs.org/cookie/-/cookie-0.1.0.tgz
npm ERR! fetch failed https://registry.npmjs.org/send/-/send-0.1.4.tgz
npm http GET https://registry.npmjs.org/minimist
npm http 200 https://registry.npmjs.org/bytes/-/bytes-0.2.0.tgz
npm http 304 https://registry.npmjs.org/uid2/0.0.2
npm http 304 https://registry.npmjs.org/methods/0.0.1
npm http 304 https://registry.npmjs.org/debug
npm http GET https://registry.npmjs.org/methods/-/methods-0.0.1.tgz
npm http GET https://registry.npmjs.org/uid2/-/uid2-0.0.2.tgz
npm http 200 https://registry.npmjs.org/pause/-/pause-0.0.1.tgz
npm http 304 https://registry.npmjs.org/lru-cache
npm http 304 https://registry.npmjs.org/i
npm http 304 https://registry.npmjs.org/deep-equal
npm http 304 https://registry.npmjs.org/mkdirp
npm http 200 https://registry.npmjs.org/methods/-/methods-0.0.1.tgz
npm http 200 https://registry.npmjs.org/uid2/-/uid2-0.0.2.tgz
npm http 304 https://registry.npmjs.org/ncp
npm http 304 https://registry.npmjs.org/async
npm http 200 https://registry.npmjs.org/fresh/-/fresh-0.2.0.tgz
npm http GET https://registry.npmjs.org/string_decoder
npm http 304 https://registry.npmjs.org/minimist
npm http GET https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/wordwrap
npm http GET https://registry.npmjs.org/redis/0.7.3
npm http 304 https://registry.npmjs.org/wordwrap
npm http GET https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.1.tgz
npm ERR! fetch failed https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.1.tgz
npm http GET https://registry.npmjs.org/cookie/-/cookie-0.1.0.tgz
npm http GET https://registry.npmjs.org/send/-/send-0.1.4.tgz
npm ERR! fetch failed https://registry.npmjs.org/cookie/-/cookie-0.1.0.tgz
npm http 200 https://registry.npmjs.org/send/-/send-0.1.4.tgz
npm http GET https://registry.npmjs.org/string_decoder
npm http GET https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/redis/0.7.3
npm http 304 https://registry.npmjs.org/redis/0.7.3
npm http GET https://registry.npmjs.org/redis/-/redis-0.7.3.tgz
npm ERR! fetch failed https://registry.npmjs.org/redis/-/redis-0.7.3.tgz
npm http GET https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.1.tgz
npm http GET https://registry.npmjs.org/recursive-readdir/0.0.2
npm http GET https://registry.npmjs.org/fsevents/0.1.6
npm http 304 https://registry.npmjs.org/recursive-readdir/0.0.2
npm http GET https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-0.0.2.tgz
npm ERR! fetch failed https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-0.0.2.tgz
npm http GET https://registry.npmjs.org/fsevents/0.1.6
npm http GET https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-0.0.2.tgz
npm ERR! fetch failed https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-0.0.2.tgz
npm http GET https://registry.npmjs.org/fsevents/0.1.6
npm http GET https://registry.npmjs.org/fsevents/-/fsevents-0.1.6.tgz
npm http 200 https://registry.npmjs.org/fsevents/-/fsevents-0.1.6.tgz
npm http GET https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-0.0.2.tgz
npm ERR! fetch failed https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-0.0.2.tgz
npm ERR! Error: SELF_SIGNED_CERT_IN_CHAIN
npm ERR!     at SecurePair.<anonymous> (tls.js:1349:32)
npm ERR!     at SecurePair.EventEmitter.emit (events.js:92:17)
npm ERR!     at SecurePair.maybeInitFinished (tls.js:962:10)
npm ERR!     at CleartextStream.read [as _read] (tls.js:463:15)
npm ERR!     at CleartextStream.Readable.read (_stream_readable.js:320:10)
npm ERR!     at EncryptedStream.write [as _write] (tls.js:366:25)
npm ERR!     at doWrite (_stream_writable.js:219:10)
npm ERR!     at writeOrBuffer (_stream_writable.js:209:5)
npm ERR!     at EncryptedStream.Writable.write (_stream_writable.js:180:11)
npm ERR!     at write (_stream_readable.js:573:24)
npm ERR!     at flow (_stream_readable.js:582:7)
npm ERR!     at Socket.pipeOnReadable (_stream_readable.js:614:5)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Darwin 13.0.0
npm ERR! command "/usr/local/Cellar/node/0.10.13/bin/node" "/usr/local/Cellar/node/0.10.13/bin/npm" "install" "fsevents@0.1.6" "recursive-readdir@0.0.2"
npm ERR! cwd /usr/local/share/npm/lib/node_modules/karma/node_modules/chokidar
npm ERR! node -v v0.10.13
npm ERR! npm -v 1.3.2
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /usr/local/share/npm/lib/node_modules/karma/node_modules/chokidar/npm-debug.log
npm ERR! not ok code 0
npm ERR! fetch failed https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.1.tgz
unbuild connect@2.8.8
unbuild karma@0.10.9
npm ERR! Error: SELF_SIGNED_CERT_IN_CHAIN
npm ERR!     at SecurePair.<anonymous> (tls.js:1349:32)
npm ERR!     at SecurePair.EventEmitter.emit (events.js:92:17)
npm ERR!     at SecurePair.maybeInitFinished (tls.js:962:10)
npm ERR!     at CleartextStream.read [as _read] (tls.js:463:15)
npm ERR!     at CleartextStream.Readable.read (_stream_readable.js:320:10)
npm ERR!     at EncryptedStream.write [as _write] (tls.js:366:25)
npm ERR!     at doWrite (_stream_writable.js:219:10)
npm ERR!     at writeOrBuffer (_stream_writable.js:209:5)
npm ERR!     at EncryptedStream.Writable.write (_stream_writable.js:180:11)
npm ERR!     at write (_stream_readable.js:573:24)
npm ERR!     at flow (_stream_readable.js:582:7)
npm ERR!     at Socket.pipeOnReadable (_stream_readable.js:614:5)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Darwin 13.0.0
npm ERR! command "/usr/local/Cellar/node/0.10.13/bin/node" "/usr/local/bin/npm" "install" "-g" "karma"
npm ERR! cwd /Users/Alex/Documents/Bitbucket
npm ERR! node -v v0.10.13
npm ERR! npm -v 1.3.2
npm http GET https://registry.npmjs.org/cookie/-/cookie-0.1.0.tgz
npm ERR! fetch failed https://registry.npmjs.org/cookie/-/cookie-0.1.0.tgz
npm http GET https://registry.npmjs.org/string_decoder
npm http GET https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.25-1.tgz
npm ERR! fetch failed https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.25-1.tgz
npm http GET https://registry.npmjs.org/redis/-/redis-0.7.3.tgz
npm ERR! fetch failed https://registry.npmjs.org/redis/-/redis-0.7.3.tgz
npm http GET https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.25-1.tgz
npm http 200 https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.25-1.tgz
npm http GET https://registry.npmjs.org/redis/-/redis-0.7.3.tgz
npm ERR! fetch failed https://registry.npmjs.org/redis/-/redis-0.7.3.tgz
npm WARN optional dep failed, continuing redis@0.7.3
npm http GET https://registry.npmjs.org/uglify-js/1.2.5
npm http GET https://registry.npmjs.org/xmlhttprequest/1.4.2
npm http GET https://registry.npmjs.org/active-x-obfuscator/0.0.1
npm http GET https://registry.npmjs.org/ws
npm http 200 https://registry.npmjs.org/xmlhttprequest/1.4.2
npm http 200 https://registry.npmjs.org/active-x-obfuscator/0.0.1
npm http GET https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.4.2.tgz
npm http GET https://registry.npmjs.org/active-x-obfuscator/-/active-x-obfuscator-0.0.1.tgz
npm ERR! fetch failed https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.4.2.tgz
npm ERR! fetch failed https://registry.npmjs.org/active-x-obfuscator/-/active-x-obfuscator-0.0.1.tgz
npm http GET https://registry.npmjs.org/uglify-js/1.2.5
npm http GET https://registry.npmjs.org/ws
npm http 200 https://registry.npmjs.org/uglify-js/1.2.5
npm http GET https://registry.npmjs.org/uglify-js/-/uglify-js-1.2.5.tgz
npm http GET https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.4.2.tgz
npm http GET https://registry.npmjs.org/active-x-obfuscator/-/active-x-obfuscator-0.0.1.tgz
npm http 304 https://registry.npmjs.org/ws
npm ERR! fetch failed https://registry.npmjs.org/uglify-js/-/uglify-js-1.2.5.tgz
npm ERR! fetch failed https://registry.npmjs.org/active-x-obfuscator/-/active-x-obfuscator-0.0.1.tgz
npm http 200 https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.4.2.tgz
npm http GET https://registry.npmjs.org/uglify-js/-/uglify-js-1.2.5.tgz
npm http 200 https://registry.npmjs.org/uglify-js/-/uglify-js-1.2.5.tgz
npm http GET https://registry.npmjs.org/active-x-obfuscator/-/active-x-obfuscator-0.0.1.tgz
npm http 200 https://registry.npmjs.org/active-x-obfuscator/-/active-x-obfuscator-0.0.1.tgz
npm http GET https://registry.npmjs.org/zeparser/0.0.5
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/tinycolor
npm http GET https://registry.npmjs.org/options
npm http GET https://registry.npmjs.org/nan
npm http 200 https://registry.npmjs.org/zeparser/0.0.5
npm http GET https://registry.npmjs.org/zeparser/-/zeparser-0.0.5.tgz
npm ERR! fetch failed https://registry.npmjs.org/zeparser/-/zeparser-0.0.5.tgz
npm http 304 https://registry.npmjs.org/nan
npm http 200 https://registry.npmjs.org/options
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/tinycolor
npm http GET https://registry.npmjs.org/zeparser/-/zeparser-0.0.5.tgz
npm ERR! fetch failed https://registry.npmjs.org/zeparser/-/zeparser-0.0.5.tgz
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/tinycolor
npm http 200 https://registry.npmjs.org/commander

> ws@0.4.31 install /usr/local/share/npm/lib/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)

npm http GET https://registry.npmjs.org/zeparser/-/zeparser-0.0.5.tgz
npm ERR! fetch failed https://registry.npmjs.org/zeparser/-/zeparser-0.0.5.tgz
unbuild active-x-obfuscator@0.0.1
unbuild socket.io-client@0.9.16
unbuild socket.io@0.9.16
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/Alex/Documents/Bitbucket/npm-debug.log
npm ERR! not ok code 0

有什么想法吗?感谢。

更新:使用下面提供的镜像我安装了Karma,但我认为我有更大的问题。

我在尝试安装依赖项和其他软件包的日志中看到的一个常见错误是:

npm ERR! Error: SELF_SIGNED_CERT_IN_CHAIN
npm ERR!     at SecurePair.<anonymous> (tls.js:1370:32)
npm ERR!     at SecurePair.EventEmitter.emit (events.js:92:17)
npm ERR!     at SecurePair.maybeInitFinished (tls.js:982:10)
npm ERR!     at CleartextStream.read [as _read] (tls.js:469:13)
npm ERR!     at CleartextStream.Readable.read (_stream_readable.js:320:10)
npm ERR!     at EncryptedStream.write [as _write] (tls.js:366:25)
npm ERR!     at doWrite (_stream_writable.js:221:10)
npm ERR!     at writeOrBuffer (_stream_writable.js:211:5)
npm ERR!     at EncryptedStream.Writable.write (_stream_writable.js:180:11)
npm ERR!     at write (_stream_readable.js:583:24)
npm ERR!     at flow (_stream_readable.js:592:7)
npm ERR!     at Socket.pipeOnReadable (_stream_readable.js:624:5)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/isaacs/npm/issues>

3 个答案:

答案 0 :(得分:4)

1)尝试从镜子安装它:

sudo npm install --registry http://registry.npmjs.eu -g karma

2)至于其他错误,请尝试:

npm config set strict-ssl false

请参阅:receiving error: 'Error: SSL Error: SELF_SIGNED_CERT_IN_CHAIN' while using npm

答案 1 :(得分:4)

不要使用http

或禁用ssl

请不要使用其他答案中陈述的strict-ssl false选项。这将忽略ssl检查。因此不安全!

官方解决方案

取而代之的是NPM的官方解决方案。

首先尝试更新npm本身。

npm install npm -g

否则告诉您当前版本的npm使用已知的注册商

npm config set ca ""

所有这些善良的来源是http://blog.npmjs.org/post/78085451721/npms-self-signed-certificate-is-no-more

答案 2 :(得分:1)

npm在他们的博客上承认了这个错误:http://blog.npmjs.org/post/78085451721/npms-self-signed-certificate-is-no-more

  

解决方案:

     

1)升级您的npm版本

     

npm install npm -g    - 或 -

     

2)告诉你当前版本的npm使用已知的注册商

     

npm config set ca ""