安装npm包

时间:2017-04-26 07:54:01

标签: node.js npm node-gyp

我正在尝试为项目安装“karma”和“grunt-karma”,我最终得到以下npm错误。我正在运行MacOS Sierra v10.12.4,安装了命令行工具的XCode v8.3.2,节点v7.9.0,node-gyp v3.5.0。

在粘贴之前,我在GitHub上阅读了所有关于这个以及其他一些的SO主题,但没有任何效果。

> bufferutil@1.1.0 install /Users/cc/project/node_modules/bufferutil
> node-gyp rebuild

  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
In file included from ../src/bufferutil.cc:16:
In file included from ../node_modules/nan/nan.h:82:
../node_modules/nan/nan_new.h:34:56: warning: 'ToInt32' is deprecated
      [-Wdeprecated-declarations]
To<v8::Int32>(v8::Handle<v8::Integer> i)   { return i->ToInt32(); }
                                                       ^
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:9041:21: note: 'ToInt32'
      has been explicitly marked deprecated here
Local<Int32> Value::ToInt32() const {
                    ^
In file included from ../src/bufferutil.cc:16:
In file included from ../node_modules/nan/nan.h:82:
../node_modules/nan/nan_new.h:39:56: warning: 'ToUint32' is deprecated
      [-Wdeprecated-declarations]
To<v8::Uint32>(v8::Handle<v8::Integer> i)  { return i->ToUint32(); }
                                                       ^
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:9035:22: note: 'ToUint32'
      has been explicitly marked deprecated here
Local<Uint32> Value::ToUint32() const {
                     ^
In file included from ../src/bufferutil.cc:16:
In file included from ../node_modules/nan/nan.h:82:
In file included from ../node_modules/nan/nan_new.h:189:
../node_modules/nan/nan_implementation_12_inl.h:49:29: warning: 'New' is
      deprecated [-Wdeprecated-declarations]
  return v8::BooleanObject::New(value).As<v8::BooleanObject>();
                            ^
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:4490:56: note: 'New' has
      been explicitly marked deprecated here
  V8_DEPRECATED("Pass an isolate", static Local<Value> New(bool value));
                                                       ^
In file included from ../src/bufferutil.cc:16:
In file included from ../node_modules/nan/nan.h:82:
In file included from ../node_modules/nan/nan_new.h:189:
../node_modules/nan/nan_implementation_12_inl.h:166:30: warning: 'Compile' is
      deprecated [-Wdeprecated-declarations]
  return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &src);
                             ^
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:1376:21: note: 'Compile'
      has been explicitly marked deprecated here
      Local<Script> Compile(Isolate* isolate, Source* source,
                    ^
In file included from ../src/bufferutil.cc:16:
In file included from ../node_modules/nan/nan.h:82:
In file included from ../node_modules/nan/nan_new.h:189:
../node_modules/nan/nan_implementation_12_inl.h:173:30: warning: 'Compile' is
      deprecated [-Wdeprecated-declarations]
  return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &src);
                             ^
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:1376:21: note: 'Compile'
      has been explicitly marked deprecated here
      Local<Script> Compile(Isolate* isolate, Source* source,
                    ^
In file included from ../src/bufferutil.cc:16:
In file included from ../node_modules/nan/nan.h:82:
In file included from ../node_modules/nan/nan_new.h:189:
../node_modules/nan/nan_implementation_12_inl.h:205:22: warning: 
      'NewFromOneByte' is deprecated [-Wdeprecated-declarations]
  return v8::String::NewFromOneByte(v8::Isolate::GetCurrent(), value,
                     ^
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:2544:21: note: 
      'NewFromOneByte' has been explicitly marked deprecated here
      Local<String> NewFromOneByte(Isolate* isolate, const uint8_t* data,
                    ^
In file included from ../src/bufferutil.cc:16:
In file included from ../node_modules/nan/nan.h:82:
In file included from ../node_modules/nan/nan_new.h:189:
../node_modules/nan/nan_implementation_12_inl.h:217:22: warning: 'NewExternal'
      is deprecated [-Wdeprecated-declarations]
  return v8::String::NewExternal(v8::Isolate::GetCurrent(), value);
                     ^
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:2582:38: note: 
      'NewExternal' has been explicitly marked deprecated here
                       Local<String> NewExternal(
                                     ^
In file included from ../src/bufferutil.cc:16:
In file included from ../node_modules/nan/nan.h:82:
In file included from ../node_modules/nan/nan_new.h:189:
../node_modules/nan/nan_implementation_12_inl.h:237:30: warning: 
      'CompileUnbound' is deprecated [-Wdeprecated-declarations]
  return v8::ScriptCompiler::CompileUnbound(v8::Isolate::GetCurrent(), &src);
                             ^
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:1356:45: note: 
      'CompileUnbound' has been explicitly marked deprecated here
                       Local<UnboundScript> CompileUnbound(
                                            ^
In file included from ../src/bufferutil.cc:16:
In file included from ../node_modules/nan/nan.h:82:
In file included from ../node_modules/nan/nan_new.h:189:
../node_modules/nan/nan_implementation_12_inl.h:244:30: warning: 
      'CompileUnbound' is deprecated [-Wdeprecated-declarations]
  return v8::ScriptCompiler::CompileUnbound(v8::Isolate::GetCurrent(), &src);
                             ^
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:1356:45: note: 
      'CompileUnbound' has been explicitly marked deprecated here
                       Local<UnboundScript> CompileUnbound(
                                            ^
In file included from ../src/bufferutil.cc:16:
../node_modules/nan/nan.h:261:25: error: redefinition of '_NanEnsureLocal'
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
                        ^
../node_modules/nan/nan.h:256:25: note: previous definition is here
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) {
                        ^
../node_modules/nan/nan.h:289:39: warning: 'IdleNotification' is deprecated
      [-Wdeprecated-declarations]
    return v8::Isolate::GetCurrent()->IdleNotification(idle_time_in_ms);
                                      ^
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:6893:22: note: 
      'IdleNotification' has been explicitly marked deprecated here
                bool IdleNotification(int idle_time_in_ms));
                     ^
In file included from ../src/bufferutil.cc:16:
../node_modules/nan/nan.h:473:20: error: no type named 'GCEpilogueCallback' in
      'v8::Isolate'
      v8::Isolate::GCEpilogueCallback callback
      ~~~~~~~~~~~~~^
../node_modules/nan/nan.h:479:20: error: no type named 'GCEpilogueCallback' in
      'v8::Isolate'
      v8::Isolate::GCEpilogueCallback callback) {
      ~~~~~~~~~~~~~^
../node_modules/nan/nan.h:484:20: error: no type named 'GCPrologueCallback' in
      'v8::Isolate'
      v8::Isolate::GCPrologueCallback callback
      ~~~~~~~~~~~~~^
../node_modules/nan/nan.h:490:20: error: no type named 'GCPrologueCallback' in
      'v8::Isolate'
      v8::Isolate::GCPrologueCallback callback) {
      ~~~~~~~~~~~~~^
../node_modules/nan/nan.h:569:15: error: no type named 'WeakCallbackData' in
      namespace 'v8'
    const v8::WeakCallbackData<T, _NanWeakCallbackInfo<T, P> > &data) {
          ~~~~^
../node_modules/nan/nan.h:569:31: error: expected ')'
    const v8::WeakCallbackData<T, _NanWeakCallbackInfo<T, P> > &data) {
                              ^
../node_modules/nan/nan.h:568:41: note: to match this '('
  static void _NanWeakCallbackDispatcher(
                                        ^
../node_modules/nan/nan.h:570:42: error: use of undeclared identifier 'data'
      _NanWeakCallbackInfo<T, P> *info = data.GetParameter();
                                         ^
../node_modules/nan/nan.h:661:13: error: no member named 'smalloc' in namespace
      'node'
    , node::smalloc::FreeCallback callback
      ~~~~~~^
../node_modules/nan/nan.h:672:12: error: no matching function for call to 'New'
    return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
           ^~~~~~~~~~~~~~~~~
/Users/cc/.node-gyp/7.9.0/include/node/node_buffer.h:46:40: note: 
      candidate function not viable: 2nd argument ('const char *') would lose
      const qualifier
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
/Users/cc/.node-gyp/7.9.0/include/node/node_buffer.h:34:40: note: 
      candidate function not viable: no known conversion from 'const char *' to
      'v8::Local<v8::String>' for 2nd argument
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
/Users/cc/.node-gyp/7.9.0/include/node/node_buffer.h:31:40: note: 
      candidate function not viable: requires 2 arguments, but 3 were provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate, size_t length);
                                       ^
/Users/cc/.node-gyp/7.9.0/include/node/node_buffer.h:39:40: note: 
      candidate function not viable: requires 5 arguments, but 3 were provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
In file included from ../src/bufferutil.cc:16:
../node_modules/nan/nan.h:676:12: error: no viable conversion from returned
      value of type 'v8::MaybeLocal<v8::Object>' to function return type
      'v8::Local<v8::Object>'
    return node::Buffer::New(v8::Isolate::GetCurrent(), size);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:221:7: note: candidate
      constructor (the implicit copy constructor) not viable: no known
      conversion from 'v8::MaybeLocal<v8::Object>' to 'const
      v8::Local<v8::Object> &' for 1st argument
class Local {
      ^
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:221:7: note: candidate
      constructor (the implicit move constructor) not viable: no known
      conversion from 'v8::MaybeLocal<v8::Object>' to 'v8::Local<v8::Object> &&'
      for 1st argument
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:225:13: note: candidate
      template ignored: could not match 'Local' against 'MaybeLocal'
  V8_INLINE Local(Local<S> that)
            ^
In file included from ../src/bufferutil.cc:16:
../node_modules/nan/nan.h:683:26: error: no member named 'Use' in namespace
      'node::Buffer'
    return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
           ~~~~~~~~~~~~~~^
../node_modules/nan/nan.h:710:32: warning: 'Compile' is deprecated
      [-Wdeprecated-declarations]
    return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &source);
                               ^
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:1376:21: note: 'Compile'
      has been explicitly marked deprecated here
      Local<Script> Compile(Isolate* isolate, Source* source,
                    ^
In file included from ../src/bufferutil.cc:16:
../node_modules/nan/nan.h:717:32: warning: 'Compile' is deprecated
      [-Wdeprecated-declarations]
    return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &source);
                               ^
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:1376:21: note: 'Compile'
      has been explicitly marked deprecated here
      Local<Script> Compile(Isolate* isolate, Source* source,
                    ^
../src/bufferutil.cc:30:5: error: call to 'NODE_SET_METHOD' is ambiguous
    NODE_SET_METHOD(t, "unmask", BufferUtil::Unmask);
    ^~~~~~~~~~~~~~~
/Users/cc/.node-gyp/7.9.0/include/node/node.h:266:25: note: expanded
      from macro 'NODE_SET_METHOD'
#define NODE_SET_METHOD node::NODE_SET_METHOD
                        ^~~~~~~~~~~~~~~~~~~~~
/Users/cc/.node-gyp/7.9.0/include/node/node.h:241:13: note: candidate
      function
inline void NODE_SET_METHOD(v8::Local<v8::Template> recv,
            ^
/Users/cc/.node-gyp/7.9.0/include/node/node.h:254:13: note: candidate
      function
inline void NODE_SET_METHOD(v8::Local<v8::Object> recv,
            ^
../src/bufferutil.cc:31:5: error: call to 'NODE_SET_METHOD' is ambiguous
    NODE_SET_METHOD(t, "mask", BufferUtil::Mask);
    ^~~~~~~~~~~~~~~
/Users/cc/.node-gyp/7.9.0/include/node/node.h:266:25: note: expanded
      from macro 'NODE_SET_METHOD'
#define NODE_SET_METHOD node::NODE_SET_METHOD
                        ^~~~~~~~~~~~~~~~~~~~~
/Users/cc/.node-gyp/7.9.0/include/node/node.h:241:13: note: candidate
      function
inline void NODE_SET_METHOD(v8::Local<v8::Template> recv,
            ^
/Users/cc/.node-gyp/7.9.0/include/node/node.h:254:13: note: candidate
      function
inline void NODE_SET_METHOD(v8::Local<v8::Object> recv,
            ^
../src/bufferutil.cc:32:5: error: call to 'NODE_SET_METHOD' is ambiguous
    NODE_SET_METHOD(t, "merge", BufferUtil::Merge);
    ^~~~~~~~~~~~~~~
/Users/cc/.node-gyp/7.9.0/include/node/node.h:266:25: note: expanded
      from macro 'NODE_SET_METHOD'
#define NODE_SET_METHOD node::NODE_SET_METHOD
                        ^~~~~~~~~~~~~~~~~~~~~
/Users/cc/.node-gyp/7.9.0/include/node/node.h:241:13: note: candidate
      function
inline void NODE_SET_METHOD(v8::Local<v8::Template> recv,
            ^
/Users/cc/.node-gyp/7.9.0/include/node/node.h:254:13: note: candidate
      function
inline void NODE_SET_METHOD(v8::Local<v8::Object> recv,
            ^
In file included from ../src/bufferutil.cc:7:
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:232:5: error: assigning to
      'v8::Primitive *volatile' from incompatible type 'v8::Value *'
    TYPE_CHECK(T, S);
    ^~~~~~~~~~~~~~~~
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:191:37: note: expanded from
      macro 'TYPE_CHECK'
    *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                    ^ ~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:414:12: note: in instantiation of function template
      specialization 'v8::Local<v8::Primitive>::Local<v8::Value>' requested here
    return NanEscapeScope(NanNew(v8::Undefined(v8::Isolate::GetCurrent())));
           ^
../node_modules/nan/nan.h:398:30: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
                             ^
In file included from ../src/bufferutil.cc:7:
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:232:5: error: assigning to
      'v8::Boolean *volatile' from incompatible type 'v8::Value *'
    TYPE_CHECK(T, S);
    ^~~~~~~~~~~~~~~~
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:191:37: note: expanded from
      macro 'TYPE_CHECK'
    *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                    ^ ~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:424:12: note: in instantiation of function template
      specialization 'v8::Local<v8::Boolean>::Local<v8::Value>' requested here
    return NanEscapeScope(NanNew(v8::True(v8::Isolate::GetCurrent())));
           ^
../node_modules/nan/nan.h:398:30: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
                             ^
In file included from ../src/bufferutil.cc:7:
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:232:5: error: assigning to
      'v8::Function *volatile' from incompatible type 'v8::Value *'
    TYPE_CHECK(T, S);
    ^~~~~~~~~~~~~~~~
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:191:37: note: expanded from
      macro 'TYPE_CHECK'
    *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                    ^ ~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:1514:12: note: in instantiation of function template
      specialization 'v8::Local<v8::Function>::Local<v8::Value>' requested here
    return NanEscapeScope(NanNew(handle)->Get(kCallbackIndex)
           ^
../node_modules/nan/nan.h:398:30: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
                             ^
In file included from ../src/bufferutil.cc:7:
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:232:5: error: assigning to
      'v8::Object *volatile' from incompatible type 'v8::Value *'
    TYPE_CHECK(T, S);
    ^~~~~~~~~~~~~~~~
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:191:37: note: expanded from
      macro 'TYPE_CHECK'
    *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                    ^ ~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:1632:12: note: in instantiation of function template
      specialization 'v8::Local<v8::Object>::Local<v8::Value>' requested here
    return NanEscapeScope(handle->Get(NanNew(key)).As<v8::Object>());
           ^
../node_modules/nan/nan.h:398:30: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
                             ^
12 warnings and 19 errors generated.
make: *** [Release/obj.target/bufferutil/src/bufferutil.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:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:194:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Darwin 16.5.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/cc/project/node_modules/bufferutil
gyp ERR! node -v v7.9.0
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok

0 个答案:

没有答案