node.js - node-gyp的build过程出错

 手机用户2502878095 发布于 2022-10-31 00:00
../src/hello.cc:6:30: error: unknown type name 'Arguments'; did you mean
      'v8::internal::Arguments'?
Handle SayHello(const Arguments& args) {
                             ^~~~~~~~~
                             v8::internal::Arguments
/Users/apple/.node-gyp/6.0.0/deps/v8/include/v8.h:145:7: note: 
      'v8::internal::Arguments' declared here
class Arguments;
      ^
../src/hello.cc:7:14: error: calling a protected constructor of class
      'v8::HandleScope'
        HandleScope scope;
                    ^
/Users/apple/.node-gyp/6.0.0/deps/v8/include/v8.h:904:13: note: declared
      protected here
  V8_INLINE HandleScope() {}
            ^
../src/hello.cc:8:15: error: no member named 'Close' in 'v8::HandleScope'
        return scope.Close(String::New("Hello World"));

../src/hello.cc:8:29: error: no member named 'New' in 'v8::String'

    return scope.Close(String::New("Hello World"));
../src/hello.cc:14:25: error: cannot initialize a parameter of type
      'v8::Isolate *' with an lvalue of type 'Handle (const
      v8::internal::Arguments &)'
                FunctionTemplate::New(SayHello)->GetFunction()
           ^~~~~~~~
/Users/apple/.node-gyp/6.0.0/deps/v8/include/v8.h:4453:16: note: passing
      argument to parameter 'isolate' here
      Isolate* isolate, FunctionCallback callback = 0,
               ^
../src/hello.cc:13:11: error: no member named 'NewSymbol' in 'v8::String'
                String::NewSymbol("sayHello"), 
6 errors generated.
make: *** [Release/obj.target/hello/src/hello.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/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/bin/node-gyp" "build"
gyp ERR! cwd /Users/apple/Desktop/use-c
gyp ERR! node -v v6.0.0
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok 

环境mac,centos全部出现一样错误

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有