最初报告EACESS错误:
richard-pc:gulp_jasmine richardmalcolm$ npm install -g karma
info trying registry request attempt 1 at 15:43:28
http GET https://registry.npmjs.org/karma
http 304 https://registry.npmjs.org/karma
npm ERR! Error: EACCES, unlink '/usr/local/lib/node_modules/karma/CHANGELOG.md'
npm ERR! { [Error: EACCES, unlink '/usr/local/lib/node_modules/karma/CHANGELOG.md']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/karma/CHANGELOG.md' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 10.8.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "karma"
npm ERR! cwd /Users/richardmalcolm/Desktop/GIT/Project-Templates/gulp_jasmine
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! path /usr/local/lib/node_modules/karma/CHANGELOG.md
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, unlink '/usr/local/lib/node_modules/karma/CHANGELOG.md'
npm ERR! error rolling back Error: EACCES, unlink '/usr/local/lib/node_modules/karma/CHANGELOG.md'
npm ERR! error rolling back { [Error: EACCES, unlink '/usr/local/lib/node_modules/karma/CHANGELOG.md']
npm ERR! error rolling back errno: 3,
npm ERR! error rolling back code: 'EACCES',
npm ERR! error rolling back path: '/usr/local/lib/node_modules/karma/CHANGELOG.md' }
npm ERR! not ok code 0
所以我接着尝试使用sudo,这让我更进一步,但报告了这一点:
richard-pc:gulp_jasmine richardmalcolm$ sudo npm install -g karma
info trying registry request attempt 1 at 15:43:38
http GET https://registry.npmjs.org/chokidar
info trying registry request attempt 1 at 15:43:38
http GET https://registry.npmjs.org/glob
info trying registry request attempt 1 at 15:43:38
http GET https://registry.npmjs.org/minimatch
info trying registry request attempt 1 at 15:43:38
http GET https://registry.npmjs.org/http-proxy
info trying registry request attempt 1 at 15:43:38
http GET https://registry.npmjs.org/optimist
info trying registry request attempt 1 at 15:43:38
http GET https://registry.npmjs.org/rimraf
info trying registry request attempt 1 at 15:43:38
http GET https://registry.npmjs.org/q
info trying registry request attempt 1 at 15:43:38
http GET https://registry.npmjs.org/colors
info trying registry request attempt 1 at 15:43:38
http GET https://registry.npmjs.org/lodash
info trying registry request attempt 1 at 15:43:38
http GET https://registry.npmjs.org/mime
info trying registry request attempt 1 at 15:43:38
http GET https://registry.npmjs.org/log4js
info trying registry request attempt 1 at 15:43:38
http GET https://registry.npmjs.org/useragent
info trying registry request attempt 1 at 15:43:38
http GET https://registry.npmjs.org/graceful-fs
info trying registry request attempt 1 at 15:43:38
http GET https://registry.npmjs.org/source-map
info trying registry request attempt 1 at 15:43:38
http GET https://registry.npmjs.org/di
info trying registry request attempt 1 at 15:43:38
http GET https://registry.npmjs.org/connect
info trying registry request attempt 1 at 15:43:38
http GET https://registry.npmjs.org/socket.io
http 304 https://registry.npmjs.org/chokidar
http 304 https://registry.npmjs.org/glob
http 304 https://registry.npmjs.org/minimatch
http 304 https://registry.npmjs.org/optimist
http 304 https://registry.npmjs.org/rimraf
http 304 https://registry.npmjs.org/q
http 304 https://registry.npmjs.org/colors
http 304 https://registry.npmjs.org/lodash
http 304 https://registry.npmjs.org/mime
http 304 https://registry.npmjs.org/graceful-fs
http 304 https://registry.npmjs.org/source-map
http 304 https://registry.npmjs.org/log4js
http 304 https://registry.npmjs.org/connect
http 304 https://registry.npmjs.org/useragent
http 304 https://registry.npmjs.org/di
http 304 https://registry.npmjs.org/http-proxy
http 304 https://registry.npmjs.org/socket.io
info trying registry request attempt 1 at 15:43:40
http GET https://registry.npmjs.org/recursive-readdir
info trying registry request attempt 1 at 15:43:40
http GET https://registry.npmjs.org/lru-cache
info trying registry request attempt 1 at 15:43:40
http GET https://registry.npmjs.org/sigmund
info trying registry request attempt 1 at 15:43:40
http GET https://registry.npmjs.org/wordwrap
info trying registry request attempt 1 at 15:43:40
http GET https://registry.npmjs.org/minimist
info trying registry request attempt 1 at 15:43:40
http GET https://registry.npmjs.org/inherits
http 304 https://registry.npmjs.org/sigmund
http 304 https://registry.npmjs.org/lru-cache
http 304 https://registry.npmjs.org/inherits
http 304 https://registry.npmjs.org/recursive-readdir
info trying registry request attempt 1 at 15:43:41
http GET https://registry.npmjs.org/socket.io-client
info trying registry request attempt 1 at 15:43:41
http GET https://registry.npmjs.org/policyfile
info trying registry request attempt 1 at 15:43:41
http GET https://registry.npmjs.org/base64id
info trying registry request attempt 1 at 15:43:41
http GET https://registry.npmjs.org/redis
http 304 https://registry.npmjs.org/minimist
http 304 https://registry.npmjs.org/wordwrap
http 304 https://registry.npmjs.org/redis
info trying registry request attempt 1 at 15:43:41
http GET https://registry.npmjs.org/amdefine
http 304 https://registry.npmjs.org/base64id
http 304 https://registry.npmjs.org/amdefine
info trying registry request attempt 1 at 15:43:41
http GET https://registry.npmjs.org/pkginfo
info trying registry request attempt 1 at 15:43:41
http GET https://registry.npmjs.org/utile
info trying registry request attempt 1 at 15:43:41
http GET https://registry.npmjs.org/semver
info trying registry request attempt 1 at 15:43:41
http GET https://registry.npmjs.org/async
info trying registry request attempt 1 at 15:43:41
http GET https://registry.npmjs.org/readable-stream
info trying registry request attempt 1 at 15:43:42
http GET https://registry.npmjs.org/batch
info trying registry request attempt 1 at 15:43:42
http GET https://registry.npmjs.org/qs
info trying registry request attempt 1 at 15:43:42
http GET https://registry.npmjs.org/cookie-signature
info trying registry request attempt 1 at 15:43:42
http GET https://registry.npmjs.org/buffer-crc32
info trying registry request attempt 1 at 15:43:42
http GET https://registry.npmjs.org/cookie
info trying registry request attempt 1 at 15:43:42
http GET https://registry.npmjs.org/send
info trying registry request attempt 1 at 15:43:42
http GET https://registry.npmjs.org/bytes
info trying registry request attempt 1 at 15:43:42
http GET https://registry.npmjs.org/fresh
info trying registry request attempt 1 at 15:43:42
http GET https://registry.npmjs.org/pause
info trying registry request attempt 1 at 15:43:42
http GET https://registry.npmjs.org/uid2
info trying registry request attempt 1 at 15:43:42
http GET https://registry.npmjs.org/debug
info trying registry request attempt 1 at 15:43:42
http GET https://registry.npmjs.org/methods
info trying registry request attempt 1 at 15:43:42
http GET https://registry.npmjs.org/raw-body
info trying registry request attempt 1 at 15:43:42
http GET https://registry.npmjs.org/negotiator
info trying registry request attempt 1 at 15:43:42
http GET https://registry.npmjs.org/multiparty
http 304 https://registry.npmjs.org/socket.io-client
http 304 https://registry.npmjs.org/policyfile
http 304 https://registry.npmjs.org/pkginfo
http 304 https://registry.npmjs.org/async
http 304 https://registry.npmjs.org/readable-stream
http 304 https://registry.npmjs.org/qs
http 304 https://registry.npmjs.org/cookie-signature
http 304 https://registry.npmjs.org/cookie
info trying registry request attempt 1 at 15:43:42
http GET https://registry.npmjs.org/nan
http 304 https://registry.npmjs.org/send
http 304 https://registry.npmjs.org/utile
http 304 https://registry.npmjs.org/bytes
http 304 https://registry.npmjs.org/fresh
http 304 https://registry.npmjs.org/pause
http 304 https://registry.npmjs.org/uid2
http 304 https://registry.npmjs.org/batch
http 304 https://registry.npmjs.org/debug
http 304 https://registry.npmjs.org/methods
info trying registry request attempt 1 at 15:43:42
http GET https://registry.npmjs.org/deep-equal
info trying registry request attempt 1 at 15:43:42
http GET https://registry.npmjs.org/i
http 304 https://registry.npmjs.org/raw-body
info trying registry request attempt 1 at 15:43:42
http GET https://registry.npmjs.org/mkdirp
info trying registry request attempt 1 at 15:43:42
http GET https://registry.npmjs.org/ncp
http 304 https://registry.npmjs.org/multiparty
http 304 https://registry.npmjs.org/deep-equal
http 304 https://registry.npmjs.org/semver
http 304 https://registry.npmjs.org/negotiator
http 304 https://registry.npmjs.org/mkdirp
http 304 https://registry.npmjs.org/buffer-crc32
http 304 https://registry.npmjs.org/nan
http 304 https://registry.npmjs.org/i
http 304 https://registry.npmjs.org/ncp
info trying registry request attempt 1 at 15:43:43
http GET https://registry.npmjs.org/string_decoder
info trying registry request attempt 1 at 15:43:43
http GET https://registry.npmjs.org/core-util-is
info trying registry request attempt 1 at 15:43:43
http GET https://registry.npmjs.org/isarray
info trying registry request attempt 1 at 15:43:43
http GET https://registry.npmjs.org/range-parser
> fsevents@0.2.1 install /usr/local/lib/node_modules/karma/node_modules/chokidar/node_modules/fsevents
> node-gyp rebuild
http 304 https://registry.npmjs.org/core-util-is
http 304 https://registry.npmjs.org/isarray
http 304 https://registry.npmjs.org/string_decoder
http 304 https://registry.npmjs.org/range-parser
info trying registry request attempt 1 at 15:43:44
http GET https://registry.npmjs.org/ws
info trying registry request attempt 1 at 15:43:44
http GET https://registry.npmjs.org/xmlhttprequest
info trying registry request attempt 1 at 15:43:44
http GET https://registry.npmjs.org/active-x-obfuscator
info trying registry request attempt 1 at 15:43:44
http GET https://registry.npmjs.org/uglify-js
info trying registry request attempt 1 at 15:43:45
http GET https://registry.npmjs.org/stream-counter
http 304 https://registry.npmjs.org/uglify-js
http 304 https://registry.npmjs.org/active-x-obfuscator
http 304 https://registry.npmjs.org/xmlhttprequest
http 304 https://registry.npmjs.org/ws
http 304 https://registry.npmjs.org/stream-counter
CXX(target) Release/obj.target/fse/fsevents.o
info trying registry request attempt 1 at 15:43:46
http GET https://registry.npmjs.org/commander
info trying registry request attempt 1 at 15:43:46
http GET https://registry.npmjs.org/tinycolor
info trying registry request attempt 1 at 15:43:46
http GET https://registry.npmjs.org/options
info trying registry request attempt 1 at 15:43:46
http GET https://registry.npmjs.org/zeparser
http 304 https://registry.npmjs.org/commander
http 304 https://registry.npmjs.org/options
http 304 https://registry.npmjs.org/tinycolor
http 304 https://registry.npmjs.org/zeparser
In file included from ../fsevents.cc:86:
../src/thread.cc: In static member function ‘static void* fse::FSEvents::threadRun(void*)’:
../src/thread.cc:30: error: ‘kFSEventStreamCreateFlagFileEvents’ was not declared in this scope
In file included from ../fsevents.cc:87:
../src/constants.cc: In function ‘v8::Handle<v8::Object> Constants()’:
../src/constants.cc:19: error: ‘kFSEventStreamEventFlagItemRemoved’ was not declared in this scope
../src/constants.cc:20: error: ‘kFSEventStreamEventFlagItemInodeMetaMod’ was not declared in this scope
../src/constants.cc:21: error: ‘kFSEventStreamEventFlagItemRenamed’ was not declared in this scope
../src/constants.cc:22: error: ‘kFSEventStreamEventFlagItemModified’ was not declared in this scope
../src/constants.cc:23: error: ‘kFSEventStreamEventFlagItemFinderInfoMod’ was not declared in this scope
../src/constants.cc:24: error: ‘kFSEventStreamEventFlagItemChangeOwner’ was not declared in this scope
../src/constants.cc:25: error: ‘kFSEventStreamEventFlagItemXattrMod’ was not declared in this scope
../src/constants.cc:26: error: ‘kFSEventStreamEventFlagItemIsFile’ was not declared in this scope
../src/constants.cc:27: error: ‘kFSEventStreamEventFlagItemIsDir’ was not declared in this scope
../src/constants.cc:28: error: ‘kFSEventStreamEventFlagItemIsSymlink’ was not declared in this scope
make: *** [Release/obj.target/fse/fsevents.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Darwin 10.8.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/karma/node_modules/chokidar/node_modules/fsevents
gyp ERR! node -v v0.10.32
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
npm WARN optional dep failed, continuing fsevents@0.2.1
> ws@0.4.32 install /usr/local/lib/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(target) Release/bufferutil.node
SOLINK_MODULE(target) Release/bufferutil.node: Finished
CXX(target) Release/obj.target/validation/src/validation.o
SOLINK_MODULE(target) Release/validation.node
SOLINK_MODULE(target) Release/validation.node: Finished
karma@0.12.23 /usr/local/lib/node_modules/karma
├── di@0.0.1
├── graceful-fs@2.0.3
├── rimraf@2.2.8
├── colors@0.6.2
├── mime@1.2.11
├── q@0.9.7
├── minimatch@0.2.14 (sigmund@1.0.0, lru-cache@2.5.0)
├── optimist@0.6.1 (wordwrap@0.0.2, minimist@0.0.10)
├── glob@3.2.11 (inherits@2.0.1, minimatch@0.3.0)
├── source-map@0.1.39 (amdefine@0.1.0)
├── lodash@2.4.1
├── log4js@0.6.21 (semver@1.1.4, async@0.2.10, readable-stream@1.0.31)
├── http-proxy@0.10.4 (pkginfo@0.3.0, utile@0.2.1)
├── useragent@2.0.9 (lru-cache@2.2.4)
├── connect@2.12.0 (uid2@0.0.3, methods@0.1.0, cookie-signature@1.0.1, pause@0.0.1, fresh@0.2.0, debug@0.8.1, qs@0.6.6, bytes@0.2.1, raw-body@1.1.2, batch@0.5.0, buffer-crc32@0.2.1, cookie@0.1.0, negotiator@0.3.0, send@0.1.4, multiparty@2.2.0)
├── chokidar@0.8.4 (recursive-readdir@0.0.2)
└── socket.io@0.9.17 (base64id@0.1.0, policyfile@0.0.4, redis@0.7.3, socket.io-client@0.9.16)
我已更新到最新的节点安装,这没什么区别。 任何有帮助的帮助。