osx用npm install jsdom报错~~求助~~~~~~~
npm install jsdom
npm WARN package.json path[@0](/user/0).4.9 path is also the name of a node core module.
npm http GET http://registry.cnpmjs.org/jsdom
npm http 304 http://registry.cnpmjs.org/jsdom
npm http GET http://registry.cnpmjs.org/htmlparser2
npm http GET http://registry.cnpmjs.org/nwmatcher
npm http GET http://registry.cnpmjs.org/xmlhttprequest
npm http GET http://registry.cnpmjs.org/cssom
npm http GET http://registry.cnpmjs.org/cssstyle
npm http GET http://registry.cnpmjs.org/request
npm http GET http://registry.cnpmjs.org/contextify
npm http 304 http://registry.cnpmjs.org/htmlparser2
npm http 304 http://registry.cnpmjs.org/nwmatcher
npm http 304 http://registry.cnpmjs.org/cssom
npm http 304 http://registry.cnpmjs.org/cssstyle
npm http 304 http://registry.cnpmjs.org/request
npm http 304 http://registry.cnpmjs.org/contextify
npm http 304 http://registry.cnpmjs.org/xmlhttprequest
npm http GET http://registry.cnpmjs.org/bindings
npm http GET http://registry.cnpmjs.org/nan
npm http GET http://registry.cnpmjs.org/json-stringify-safe
npm http GET http://registry.cnpmjs.org/qs
npm http GET http://registry.cnpmjs.org/mime
npm http GET http://registry.cnpmjs.org/forever-agent
npm http GET http://registry.cnpmjs.org/node-uuid
npm http GET http://registry.cnpmjs.org/tough-cookie
npm http GET http://registry.cnpmjs.org/form-data
npm http GET http://registry.cnpmjs.org/tunnel-agent
npm http GET http://registry.cnpmjs.org/hawk
npm http GET http://registry.cnpmjs.org/oauth-sign
npm http GET http://registry.cnpmjs.org/http-signature
npm http GET http://registry.cnpmjs.org/aws-sign2
npm http GET http://registry.cnpmjs.org/domhandler
npm http GET http://registry.cnpmjs.org/domutils
npm http GET http://registry.cnpmjs.org/domelementtype
npm http GET http://registry.cnpmjs.org/readable-stream
npm http GET http://registry.cnpmjs.org/entities
npm http 304 http://registry.cnpmjs.org/nan
npm http 304 http://registry.cnpmjs.org/json-stringify-safe
npm http 304 http://registry.cnpmjs.org/mime
npm http 304 http://registry.cnpmjs.org/forever-agent
npm http 304 http://registry.cnpmjs.org/node-uuid
npm http 304 http://registry.cnpmjs.org/tough-cookie
npm http 304 http://registry.cnpmjs.org/form-data
npm http 304 http://registry.cnpmjs.org/tunnel-agent
npm http 304 http://registry.cnpmjs.org/hawk
npm http 304 http://registry.cnpmjs.org/oauth-sign
npm http 304 http://registry.cnpmjs.org/http-signature
npm http 304 http://registry.cnpmjs.org/aws-sign2
npm http 304 http://registry.cnpmjs.org/domutils
npm http 304 http://registry.cnpmjs.org/readable-stream
npm http 304 http://registry.cnpmjs.org/entities
npm http 304 http://registry.cnpmjs.org/domelementtype
npm http 304 http://registry.cnpmjs.org/bindings
> contextify[@0](/user/0).1.8 install /Users/gongwenshuo/Project/koa/node_modules/jsdom/node_modules/contextify
> node-gyp rebuild
CXX(target) Release/obj.target/contextify/src/contextify.o
In file included from ../src/contextify.cc:3:
../node_modules/nan/nan.h:337:60: error: too many arguments to function call, expected at most 3, have 4
return v8::Signature::New(nan_isolate, receiver, argc, argv);
~~~~~~~~~~~~~~~~~~ ^~~~
/Users/gongwenshuo/.node-gyp/0.11.12/deps/v8/include/v8.h:3585:3: note: 'New' declared here
static Local<Signature> New(Handle<FunctionTemplate> receiver =
^
In file included from ../src/contextify.cc:3:
../node_modules/nan/nan.h:365:27: error: cannot initialize a parameter of type 'int' with an lvalue of type 'v8::Isolate *'
return v8::Array::New(nan_isolate);
^~~~~~~~~~~
/Users/gongwenshuo/.node-gyp/0.11.12/deps/v8/include/v8.h:2335:31: note: passing argument to parameter 'length' here
static Local<Array> New(int length = 0);
^
In file included from ../src/contextify.cc:3:
../node_modules/nan/nan.h:370:40: error: too many arguments to function call, expected at most single argument 'length', have 2 arguments
return v8::Array::New(nan_isolate, length);
~~~~~~~~~~~~~~ ^~~~~~
/Users/gongwenshuo/.node-gyp/0.11.12/deps/v8/include/v8.h:2335:3: note: 'New' declared here
static Local<Array> New(int length = 0);
^
In file included from ../src/contextify.cc:3:
../node_modules/nan/nan.h:375:39: error: too many arguments to function call, expected single argument 'time', have 2 arguments
return v8::Date::New(nan_isolate, time).As<v8::Date>();
~~~~~~~~~~~~~ ^~~~
/Users/gongwenshuo/.node-gyp/0.11.12/deps/v8/include/v8.h:2866:3: note: 'New' declared here
static Local<Value> New(double time);
^
In file included from ../src/contextify.cc:3:
../node_modules/nan/nan.h:375:56: error: expected '(' for function-style cast or type construction
return v8::Date::New(nan_isolate, time).As<v8::Date>();
~~~~~~~~^
../node_modules/nan/nan.h:375:58: error: expected expression
return v8::Date::New(nan_isolate, time).As<v8::Date>();
^
../node_modules/nan/nan.h:380:39: error: too many arguments to function call, expected single argument 'time', have 2 arguments
return v8::Date::New(nan_isolate, time).As<v8::Date>();
~~~~~~~~~~~~~ ^~~~
/Users/gongwenshuo/.node-gyp/0.11.12/deps/v8/include/v8.h:2866:3: note: 'New' declared here
static Local<Value> New(double time);
^
In file included from ../src/contextify.cc:3:
../node_modules/nan/nan.h:380:56: error: expected '(' for function-style cast or type construction
return v8::Date::New(nan_isolate, time).As<v8::Date>();
~~~~~~~~^
../node_modules/nan/nan.h:380:58: error: expected expression
return v8::Date::New(nan_isolate, time).As<v8::Date>();
^
../node_modules/nan/nan.h:383:15: error: no type named 'UnboundScript' in namespace 'v8'
typedef v8::UnboundScript NanUnboundScript;
~~~~^
../node_modules/nan/nan.h:391:9: error: no member named 'ScriptCompiler' in namespace 'v8'
v8::ScriptCompiler::Source source(s, origin);
~~~~^
../node_modules/nan/nan.h:392:16: error: no member named 'ScriptCompiler' in namespace 'v8'
return v8::ScriptCompiler::CompileUnbound(nan_isolate, &source);
~~~~^
../node_modules/nan/nan.h:392:61: error: use of undeclared identifier 'source'; did you mean 'v8::Extension::source'?
return v8::ScriptCompiler::CompileUnbound(nan_isolate, &source);
^~~~~~
v8::Extension::source
/Users/gongwenshuo/.node-gyp/0.11.12/deps/v8/include/v8.h:3712:46: note: 'v8::Extension::source' declared here
const String::ExternalAsciiStringResource* source() const {
^
In file included from ../src/contextify.cc:3:
../node_modules/nan/nan.h:392:60: error: must explicitly qualify name of member function when taking its address
return v8::ScriptCompiler::CompileUnbound(nan_isolate, &source);
^~~~~~~
Extension::
../node_modules/nan/nan.h:399:9: error: no member named 'ScriptCompiler' in namespace 'v8'
v8::ScriptCompiler::Source source(s);
~~~~^
../node_modules/nan/nan.h:400:16: error: no member named 'ScriptCompiler' in namespace 'v8'
return v8::ScriptCompiler::CompileUnbound(nan_isolate, &source);
~~~~^
../node_modules/nan/nan.h:400:61: error: use of undeclared identifier 'source'; did you mean 'v8::Extension::source'?
return v8::ScriptCompiler::CompileUnbound(nan_isolate, &source);
^~~~~~
v8::Extension::source
/Users/gongwenshuo/.node-gyp/0.11.12/deps/v8/include/v8.h:3712:46: note: 'v8::Extension::source' declared here
const String::ExternalAsciiStringResource* source() const {
^
In file included from ../src/contextify.cc:3:
../node_modules/nan/nan.h:400:60: error: must explicitly qualify name of member function when taking its address
return v8::ScriptCompiler::CompileUnbound(nan_isolate, &source);
^~~~~~~
Extension::
../node_modules/nan/nan.h:405:12: error: no matching function for call to 'NewExternal'
return v8::String::NewExternal(nan_isolate, resource);
^~~~~~~~~~~~~~~~~~~~~~~
/Users/gongwenshuo/.node-gyp/0.11.12/deps/v8/include/v8.h:1791:24: note: candidate function not viable: requires single argument 'resource', but 2 arguments were provided
static Local<String> NewExternal(ExternalStringResource* resource);
^
/Users/gongwenshuo/.node-gyp/0.11.12/deps/v8/include/v8.h:1812:24: note: candidate function not viable: requires single argument 'resource', but 2 arguments were provided
static Local<String> NewExternal(ExternalAsciiStringResource* resource);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Release/obj.target/contextify/src/contextify.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.EventEmitter.emit (events.js:107:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1045:12)
gyp ERR! System Darwin 13.1.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/gongwenshuo/Project/koa/node_modules/jsdom/node_modules/contextify
gyp ERR! node -v v0.11.12
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm http 304 http://registry.cnpmjs.org/qs
npm http 304 http://registry.cnpmjs.org/domhandler
npm http GET http://registry.cnpmjs.org/combined-stream
npm http GET http://registry.cnpmjs.org/async
npm http GET http://registry.cnpmjs.org/assert-plus/0.1.2
npm http GET http://registry.cnpmjs.org/asn1/0.1.11
npm http GET http://registry.cnpmjs.org/ctype/0.5.2
npm http GET http://registry.cnpmjs.org/core-util-is
npm http GET http://registry.cnpmjs.org/isarray/0.0.1
npm http GET http://registry.cnpmjs.org/string_decoder
npm http GET http://registry.cnpmjs.org/inherits
npm http GET http://registry.cnpmjs.org/punycode
npm http GET http://registry.cnpmjs.org/hoek
npm http GET http://registry.cnpmjs.org/boom
npm http GET http://registry.cnpmjs.org/cryptiles
npm http GET http://registry.cnpmjs.org/sntp
npm http 304 http://registry.cnpmjs.org/async
npm http 304 http://registry.cnpmjs.org/assert-plus/0.1.2
npm http 304 http://registry.cnpmjs.org/asn1/0.1.11
npm http 304 http://registry.cnpmjs.org/ctype/0.5.2
npm http 304 http://registry.cnpmjs.org/core-util-is
npm http 304 http://registry.cnpmjs.org/isarray/0.0.1
npm http 304 http://registry.cnpmjs.org/string_decoder
npm http 304 http://registry.cnpmjs.org/punycode
npm http 304 http://registry.cnpmjs.org/hoek
npm http 304 http://registry.cnpmjs.org/boom
npm http 304 http://registry.cnpmjs.org/cryptiles
npm http 304 http://registry.cnpmjs.org/sntp
npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/Users/gongwenshuo/Project/koa/node_modules/jsdom/node_modules/request/node_modules/http-signature/node_modules/asn1'
npm ERR! error rolling back jsdom[@0](/user/0).10.5 { [Error: ENOTEMPTY, rmdir '/Users/gongwenshuo/Project/koa/node_modules/jsdom/node_modules/request/node_modules/http-signature/node_modules/asn1']
npm ERR! error rolling back stack: 'Error: ENOTEMPTY, rmdir \'/Users/gongwenshuo/Project/koa/node_modules/jsdom/node_modules/request/node_modules/http-signature/node_modules/asn1\'',
npm ERR! error rolling back errno: -66,
npm ERR! error rolling back code: 'ENOTEMPTY',
npm ERR! error rolling back path: '/Users/gongwenshuo/Project/koa/node_modules/jsdom/node_modules/request/node_modules/http-signature/node_modules/asn1' }
npm ERR! contextify[@0](/user/0).1.8 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the contextify[@0](/user/0).1.8 install script.
npm ERR! This is most likely a problem with the contextify package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls contextify
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 13.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "jsdom"
npm ERR! cwd /Users/gongwenshuo/Project/koa
npm ERR! node -v v0.11.12
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR! Error: ENOENT, open '/Users/gongwenshuo/Project/koa/node_modules/jsdom/node_modules/request/node_modules/http-signature/node_modules/ctype/ctio.js'
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/npm/npm/issues>
npm ERR! System Darwin 13.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "jsdom"
npm ERR! cwd /Users/gongwenshuo/Project/koa
npm ERR! node -v v0.11.12
npm ERR! npm -v 1.4.3
npm ERR! path /Users/gongwenshuo/Project/koa/node_modules/jsdom/node_modules/request/node_modules/http-signature/node_modules/ctype/ctio.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! Error: ENOENT, lstat '/Users/gongwenshuo/Project/koa/node_modules/jsdom/node_modules/request/node_modules/http-signature/node_modules/assert-plus/assert.js'
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/npm/npm/issues>
npm ERR! System Darwin 13.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "jsdom"
npm ERR! cwd /Users/gongwenshuo/Project/koa
npm ERR! node -v v0.11.12
npm ERR! npm -v 1.4.3
npm ERR! path /Users/gongwenshuo/Project/koa/node_modules/jsdom/node_modules/request/node_modules/http-signature/node_modules/assert-plus/assert.js
npm ERR! fstream_path /Users/gongwenshuo/Project/koa/node_modules/jsdom/node_modules/request/node_modules/http-signature/node_modules/assert-plus/assert.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:97:15)
npm WARN optional dep failed, continuing http-signature[@0](/user/0).10.0
npm http 304 http://registry.cnpmjs.org/combined-stream
npm http GET http://registry.cnpmjs.org/delayed-stream/0.0.5
npm http 304 http://registry.cnpmjs.org/inherits
npm http 304 http://registry.cnpmjs.org/delayed-stream/0.0.5
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/gongwenshuo/Project/koa/npm-debug.log
npm ERR! not ok code 0
2 回复
gcc正常啊啊啊
个人觉得可能是这个jsdom的版本问题,去它的官网看看吧,应该不是你本机的问题。