node-threads-a-gogo2 icon indicating copy to clipboard operation
node-threads-a-gogo2 copied to clipboard

无论npm安装还是源码安装,都报错

Open Link14349 opened this issue 6 years ago • 0 comments

npm 安装的报错

npm ERR! path /Users/zhengyuanhao/Documents/ddos/node_modules/aproba
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/Users/zhengyuanhao/Documents/ddos/node_modules/aproba'
npm ERR!  { Error: EACCES: permission denied, access '/Users/zhengyuanhao/Documents/ddos/node_modules/aproba'
npm ERR!   stack: 'Error: EACCES: permission denied, access \'/Users/zhengyuanhao/Documents/ddos/node_modules/aproba\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/Users/zhengyuanhao/Documents/ddos/node_modules/aproba' }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/zhengyuanhao/.npm/_logs/2018-08-04T05_33_50_187Z-debug.log

git下载是成功了,但是运行node-gyp rebuild这一步就出错:

  CXX(target) Release/obj.target/threads_a_gogo/src/threads_a_gogo.o
../src/threads_a_gogo.cpp:86:3: error: unknown type name 'uv_async_t'
  uv_async_t async_watcher; //MUST be the first one 使用 libuv
  ^
../src/threads_a_gogo.cpp:166:41: error: unknown type name 'Arguments'; did you
      mean 'v8::internal::Arguments'?
static Handle<Value> require_file(const Arguments &args) //读取js文件
                                        ^~~~~~~~~
                                        v8::internal::Arguments
/Users/zhengyuanhao/.node-gyp/8.11.2/include/node/v8.h:141:7: note: 
      'v8::internal::Arguments' declared here
class Arguments;
      ^
../src/threads_a_gogo.cpp:168:14: error: calling a protected constructor of
      class 'v8::HandleScope'
        HandleScope scope;
                    ^
/Users/zhengyuanhao/.node-gyp/8.11.2/include/node/v8.h:875:13: note: declared
      protected here
  V8_INLINE HandleScope() {}
            ^
../src/threads_a_gogo.cpp:170:11: error: type 'const v8::internal::Arguments'
      does not provide a subscript operator
                if(!args[0]->IsString()){
                    ~~~~^~
../src/threads_a_gogo.cpp:171:54: error: no member named 'New' in 'v8::String'
                return ThrowException(Exception::TypeError(String::New("...
                                                           ~~~~~~~~^
../src/threads_a_gogo.cpp:174:27: error: member access into incomplete type
      'const v8::internal::Arguments'
        Local<Object> Gobj = args.This();
                                 ^
/Users/zhengyuanhao/.node-gyp/8.11.2/include/node/v8.h:141:7: note: forward
      declaration of 'v8::internal::Arguments'
class Arguments;
      ^
../src/threads_a_gogo.cpp:176:60: error: no member named
      'GetPointerFromInternalField' in 'v8::Object'
        String::Utf8Value* dirname_p = (String::Utf8Value*) Gobj->GetPoi...
                                                            ~~~~  ^
../src/threads_a_gogo.cpp:182:59: error: no member named 'New' in 'v8::String'
        Local<Object> path_resolve_obj = Script::Compile(String::New(pat...
                                                         ~~~~~~~~^
../src/threads_a_gogo.cpp:186:66: error: no member named 'New' in 'v8::String'
        Local<Object> path_resolve_func = path_resolve_obj->Get(String::New("res...
                                                                ~~~~~~~~^
../src/threads_a_gogo.cpp:189:23: error: no member named 'New' in 'v8::String'
    argv[0] = String::New(dirname.c_str());
              ~~~~~~~~^
../src/threads_a_gogo.cpp:190:16: error: type 'const v8::internal::Arguments'
      does not provide a subscript operator
        argv[1] = args[0];
                  ~~~~^~
../src/threads_a_gogo.cpp:192:78: error: too few arguments to function call,
      single argument 'isolate' was not specified
  ...path_str_value = path_resolve_func->CallAsFunction(Object::New(), 2, argv);
                                                        ~~~~~~~~~~~ ^
/Users/zhengyuanhao/.node-gyp/8.11.2/include/node/v8.h:3491:3: note: 'New'
      declared here
  static Local<Object> New(Isolate* isolate);
  ^
../src/threads_a_gogo.cpp:199:32: error: no member named 'New' in 'v8::String'
        char *file = readFile(String::New(path_str.c_str()));
                              ~~~~~~~~^
../src/threads_a_gogo.cpp:201:11: warning: 'TryCatch' is deprecated
      [-Wdeprecated-declarations]
        TryCatch onError;
                 ^
/Users/zhengyuanhao/.node-gyp/8.11.2/include/node/v8.h:8313:3: note: 'TryCatch'
      has been explicitly marked deprecated here
  V8_DEPRECATED("Use isolate version", TryCatch());
  ^
/Users/zhengyuanhao/.node-gyp/8.11.2/include/node/v8config.h:321:29: note: 
      expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../src/threads_a_gogo.cpp:202:26: error: no member named 'New' in 'v8::String'
        Script::Compile(String::New(file))->Run();
                        ~~~~~~~~^
../src/threads_a_gogo.cpp:208:54: error: no member named 'New' in 'v8::String'
                return ThrowException(Exception::TypeError(String::New(e...
                                                           ~~~~~~~~^
../src/threads_a_gogo.cpp:211:15: error: no member named 'Close' in
      'v8::HandleScope'
        return scope.Close(Gobj);
               ~~~~~ ^
../src/threads_a_gogo.cpp:236:39: error: no member named
      'GetPointerFromInternalField' in 'v8::Object'
      thread= (typeThread*) receiver->GetPointerFromInternalField(0); //...
                            ~~~~~~~~  ^
../src/threads_a_gogo.cpp:265:34: error: unknown type name 'Arguments'; did you
      mean 'v8::internal::Arguments'?
static Handle<Value> Puts (const Arguments &args) {
                                 ^~~~~~~~~
                                 v8::internal::Arguments
/Users/zhengyuanhao/.node-gyp/8.11.2/include/node/v8.h:141:7: note: 
      'v8::internal::Arguments' declared here
class Arguments;
      ^
../src/threads_a_gogo.cpp:268:15: error: calling a protected constructor of
      class 'v8::HandleScope'
  HandleScope scope;
              ^
/Users/zhengyuanhao/.node-gyp/8.11.2/include/node/v8.h:875:13: note: declared
      protected here
  V8_INLINE HandleScope() {}
            ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
make: *** [Release/obj.target/threads_a_gogo/src/threads_a_gogo.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:262:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Darwin 17.5.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/bin/node-gyp" "rebuild"
gyp ERR! cwd /Users/zhengyuanhao/Documents/ddos/node-threads-a-gogo2
gyp ERR! node -v v8.11.2
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok

我是mac用户

Link14349 avatar Aug 04 '18 05:08 Link14349