Node.js 无法在mac osx上使用npm生成runas

Node.js 无法在mac osx上使用npm生成runas,node.js,macos,npm,npm-install,Node.js,Macos,Npm,Npm Install,我正在尝试安装程序包runas,但由于未知原因失败 我试过安装xcode和开发工具,然后我把我的MacOSX升级到了10.15.17,我的xcode也随之升级。我也检查过了,我的电脑上也安装了clang和g++ MacOSX:10.15.7 XCODE:12.1 节点-v14.15.0 净现值:6.14.8 这是构建openvpn bin所必需的包 日志: macbook@MacBook-MBP VPN指定%npm安装运行方式 > runas@3.1.1安装/Users/macbook/Desk

我正在尝试安装程序包runas,但由于未知原因失败

我试过安装xcode和开发工具,然后我把我的MacOSX升级到了10.15.17,我的xcode也随之升级。我也检查过了,我的电脑上也安装了clang和g++

MacOSX:10.15.7 XCODE:12.1 节点-v14.15.0 净现值:6.14.8

这是构建openvpn bin所必需的包

日志:

macbook@MacBook-MBP VPN指定%npm安装运行方式
> runas@3.1.1安装/Users/macbook/Desktop/VPNMaze/node_modules/runas
>节点gyp重建
CXX(目标)发布/obj.target/runas/src/main.o
../src/main.cc:19:24:错误:从“v8::Local”转换为“String::Utf8Value”的函数样式转换没有匹配的转换
std::string命令(*string::Utf8Value(信息[0]);
^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/macbook/Library/Caches/node-gyp/14.15.0/include/node/v8.h:3294:5:注意:候选构造函数不可行:未知
第一个参数从“v8::Local”转换为“const v8::String::Utf8Value”
Utf8Value(常量Utf8Value&)=删除;
^
/Users/macbook/Library/Caches/node-gyp/14.15.0/include/node/v8.h:3287:5:注意:候选构造函数不可行:需要2
参数,但提供了1
UTF8值(隔离*隔离,局部obj);
^
../src/main.cc:27:48:错误:调用“Get”时没有匹配的成员函数
std::string arg(*string::Utf8Value(v_args->Get(i));
~~~~~~~~^~~
/Users/macbook/Library/Caches/node-gyp/14.15.0/include/node/v8.h:3717:43:注意:候选函数不可行:需要2
参数,但提供了1
V8_警告_未使用_结果可能本地获取(本地上下文,
^
/Users/macbook/Library/Caches/node-gyp/14.15.0/include/node/v8.h:3720:43:注意:候选函数不可行:需要2
参数,但提供了1
V8_警告_未使用_结果可能本地获取(本地上下文,
^
../src/main.cc:32:47:错误:函数调用的参数太少,未指定单个参数“上下文”
本地v_选项=信息[2]->ToObject();
~~~~~~~~~~~~~~~~~ ^
/Users/macbook/Library/Caches/node-gyp/14.15.0/include/node/v8.h:2822:3:注意:此处声明了“ToObject”
V8_警告_未使用_结果可能是本地对象(
^
/Users/macbook/Library/Caches/node gyp/14.15.0/include/node/v8config.h:431:31:注意:从宏“V8\u WARN\u UNUSED\u RESULT”展开
#定义V8_警告_未使用_结果_属性_((警告_未使用_结果))
^
../src/main.cc:34:73:错误:参数太少,无法调用函数,未指定单个参数“隔离”
if(GetProperty(v_选项、“隐藏”、&v_值)&&v_值->布尔值()
~~~~~~~~~~~~~~~~~~~~~ ^
/Users/macbook/Library/Caches/node-gyp/14.15.0/include/node/v8.h:2858:3:注意:此处声明了“BooleanValue”
布尔布尔值(隔离*隔离)常数;
^
../src/main.cc:36:74:错误:参数太少,无法调用函数,未指定单个参数“隔离”
if(GetProperty(v_选项,“admin”、&v_值)&&v_值->布尔值()
~~~~~~~~~~~~~~~~~~~~~ ^
/Users/macbook/Library/Caches/node-gyp/14.15.0/include/node/v8.h:2858:3:注意:此处声明了“BooleanValue”
布尔布尔值(隔离*隔离)常数;
^
../src/main.cc:41:18:错误:函数样式从“Local”转换为“String::Utf8Value”时没有匹配的转换
标准输入=*字符串::Utf8Value(v_值);
^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/macbook/Library/Caches/node-gyp/14.15.0/include/node/v8.h:3294:5:注意:候选构造函数不可行:未知
第一个参数从“Local”转换为“const v8::String::Utf8Value”
Utf8Value(常量Utf8Value&)=删除;
^
/Users/macbook/Library/Caches/node-gyp/14.15.0/include/node/v8.h:3287:5:注意:候选构造函数不可行:需要2
参数,但提供了1
UTF8值(隔离*隔离,局部obj);
^
../src/main.cc:45:45:错误:参数太少,无法调用函数,未指定单个参数“隔离”
v_值->布尔值();
~~~~~~~~~~~~~~~~~~~~~ ^
/Users/macbook/Library/Caches/node-gyp/14.15.0/include/node/v8.h:2858:3:注意:此处声明了“BooleanValue”
布尔布尔值(隔离*隔离)常数;
^
../src/main.cc:70:11:错误:没有名为“Handle”的模板
void Init(句柄导出){
^
产生了8个错误。
make:**[Release/obj.target/runas/src/main.o]错误1
gyp错误!生成错误
gyp ERR!堆栈错误:`make`失败,退出代码:2
gyp ERR!在ChildProcess.onExit上堆叠(/usr/local/lib/node_modules/npm/node_modules/npm lifecycle/node_modules/node gyp/lib/build.js:194:23)
ChildProcess.emit(events.js:315:20)上的gyp ERR!堆栈
gyp ERR!在Process.ChildProcess.\u handle.onexit处堆栈(internal/child\u Process.js:277:12)
gyp ERR!系统达尔文19.2.0
gyp ERR!命令“/usr/local/bin/node”“/usr/local/lib/node_modules/npm/node_modules/npm lifecycle/node_modules/node gyp/bin/node gyp.js”“重建”
gyp ERR!cwd/Users/macbook/Desktop/VPNMaze/node_modules/runas
GypErr!节点-v14.15.0
gyp ERR!节点gyp-v5.1.1
哎呀!不行
npm错误!代码错误周期
npm错误!错误1
npm错误!runas@3.1.1安装:`node gyp rebuild`
npm错误!退出状态1
npm错误!
npm ERR!在以下位置失败:runas@3.1.1安装脚本。
npm错误!这可能不是npm的问题。上面可能还有其他日志输出。
npm ERR!此运行的完整日志可在以下位置找到:```
调试日志:
```0信息如果以“确定”结尾,则有效
1详细cli[
1个详细cli'/usr/local/bin/node',
1个详细cli'/usr/local/bin/npm',
1详细cli“安装”,
1个详细cli'-g',
1详细cli“运行方式”
1详细cli]
2信息使用npm@6.14.8
3信息使用node@v14.15.0
4详细的npm会话de21ec6342802a8b
5.安装
macbook@MacBook-MBP VPNMaze % npm install runas
> runas@3.1.1 install /Users/macbook/Desktop/VPNMaze/node_modules/runas
> node-gyp rebuild

  CXX(target) Release/obj.target/runas/src/main.o
../src/main.cc:19:24: error: no matching conversion for functional-style cast from 'v8::Local<v8::Value>' to 'String::Utf8Value'
  std::string command(*String::Utf8Value(info[0]));
                       ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/macbook/Library/Caches/node-gyp/14.15.0/include/node/v8.h:3294:5: note: candidate constructor not viable: no known
      conversion from 'v8::Local<v8::Value>' to 'const v8::String::Utf8Value' for 1st argument
    Utf8Value(const Utf8Value&) = delete;
    ^
/Users/macbook/Library/Caches/node-gyp/14.15.0/include/node/v8.h:3287:5: note: candidate constructor not viable: requires 2
      arguments, but 1 was provided
    Utf8Value(Isolate* isolate, Local<v8::Value> obj);
    ^
../src/main.cc:27:48: error: no matching member function for call to 'Get'
    std::string arg(*String::Utf8Value(v_args->Get(i)));
                                       ~~~~~~~~^~~
/Users/macbook/Library/Caches/node-gyp/14.15.0/include/node/v8.h:3717:43: note: candidate function not viable: requires 2
      arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
/Users/macbook/Library/Caches/node-gyp/14.15.0/include/node/v8.h:3720:43: note: candidate function not viable: requires 2
      arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
../src/main.cc:32:47: error: too few arguments to function call, single argument 'context' was not specified
  Local<Object> v_options = info[2]->ToObject();
                            ~~~~~~~~~~~~~~~~~ ^
/Users/macbook/Library/Caches/node-gyp/14.15.0/include/node/v8.h:2822:3: note: 'ToObject' declared here
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
  ^
/Users/macbook/Library/Caches/node-gyp/14.15.0/include/node/v8config.h:431:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../src/main.cc:34:73: error: too few arguments to function call, single argument 'isolate' was not specified
  if (GetProperty(v_options, "hide", &v_value) && v_value->BooleanValue())
                                                  ~~~~~~~~~~~~~~~~~~~~~ ^
/Users/macbook/Library/Caches/node-gyp/14.15.0/include/node/v8.h:2858:3: note: 'BooleanValue' declared here
  bool BooleanValue(Isolate* isolate) const;
  ^
../src/main.cc:36:74: error: too few arguments to function call, single argument 'isolate' was not specified
  if (GetProperty(v_options, "admin", &v_value) && v_value->BooleanValue())
                                                   ~~~~~~~~~~~~~~~~~~~~~ ^
/Users/macbook/Library/Caches/node-gyp/14.15.0/include/node/v8.h:2858:3: note: 'BooleanValue' declared here
  bool BooleanValue(Isolate* isolate) const;
  ^
../src/main.cc:41:18: error: no matching conversion for functional-style cast from 'Local<v8::Value>' to 'String::Utf8Value'
    std_input = *String::Utf8Value(v_value);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/macbook/Library/Caches/node-gyp/14.15.0/include/node/v8.h:3294:5: note: candidate constructor not viable: no known
      conversion from 'Local<v8::Value>' to 'const v8::String::Utf8Value' for 1st argument
    Utf8Value(const Utf8Value&) = delete;
    ^
/Users/macbook/Library/Caches/node-gyp/14.15.0/include/node/v8.h:3287:5: note: candidate constructor not viable: requires 2
      arguments, but 1 was provided
    Utf8Value(Isolate* isolate, Local<v8::Value> obj);
    ^
../src/main.cc:45:45: error: too few arguments to function call, single argument 'isolate' was not specified
                      v_value->BooleanValue();
                      ~~~~~~~~~~~~~~~~~~~~~ ^
/Users/macbook/Library/Caches/node-gyp/14.15.0/include/node/v8.h:2858:3: note: 'BooleanValue' declared here
  bool BooleanValue(Isolate* isolate) const;
  ^
../src/main.cc:70:11: error: no template named 'Handle'
void Init(Handle<Object> exports) {
          ^
8 errors generated.
make: *** [Release/obj.target/runas/src/main.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/npm-lifecycle/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Darwin 19.2.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/macbook/Desktop/VPNMaze/node_modules/runas
gyp ERR! node -v v14.15.0
gyp ERR! node-gyp -v v5.1.1
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! runas@3.1.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the runas@3.1.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:```

Debug log:
```0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'install',
1 verbose cli   '-g',
1 verbose cli   'runas'
1 verbose cli ]
2 info using npm@6.14.8
3 info using node@v14.15.0
4 verbose npm-session de21ec6342802a8b
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 200 https://registry.npmjs.org/runas 32ms (from cache)
8 silly pacote tag manifest for runas@latest fetched in 56ms
9 timing stage:loadCurrentTree Completed in 116ms
10 silly install loadIdealTree
11 silly install cloneCurrentTreeToIdealTree
12 timing stage:loadIdealTree:cloneCurrentTree Completed in 0ms
13 silly install loadShrinkwrap
14 timing stage:loadIdealTree:loadShrinkwrap Completed in 2ms
15 silly install loadAllDepsIntoIdealTree
16 silly resolveWithNewModule runas@3.1.1 checking installable status
17 http fetch GET 304 https://registry.npmjs.org/nan 219ms (from cache)
18 silly pacote range manifest for nan@2.x fetched in 226ms
19 silly resolveWithNewModule nan@2.14.2 checking installable status
20 timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 234ms
21 timing stage:loadIdealTree Completed in 240ms
22 silly currentTree lib
23 silly idealTree lib
23 silly idealTree └─┬ runas@3.1.1
23 silly idealTree   └── nan@2.14.2
24 silly install generateActionsToTake
25 timing stage:generateActionsToTake Completed in 6ms
26 silly diffTrees action count 2
27 silly diffTrees add nan@2.14.2
28 silly diffTrees add runas@3.1.1
29 silly decomposeActions action count 16
30 silly decomposeActions fetch nan@2.14.2
31 silly decomposeActions extract nan@2.14.2
32 silly decomposeActions preinstall nan@2.14.2
33 silly decomposeActions build nan@2.14.2
34 silly decomposeActions install nan@2.14.2
35 silly decomposeActions postinstall nan@2.14.2
36 silly decomposeActions finalize nan@2.14.2
37 silly decomposeActions refresh-package-json nan@2.14.2
38 silly decomposeActions fetch runas@3.1.1
39 silly decomposeActions extract runas@3.1.1
40 silly decomposeActions preinstall runas@3.1.1
41 silly decomposeActions build runas@3.1.1
42 silly decomposeActions install runas@3.1.1
43 silly decomposeActions postinstall runas@3.1.1
44 silly decomposeActions finalize runas@3.1.1
45 silly decomposeActions refresh-package-json runas@3.1.1
46 silly install executeActions
47 silly doSerial global-install 16
48 verbose correctMkdir /Users/macbook/.npm/_locks correctMkdir not in flight; initializing
49 verbose lock using /Users/macbook/.npm/_locks/staging-3a08f0df5026584d.lock for /usr/local/lib/node_modules/.staging
50 silly doParallel extract 2
51 silly extract nan@2.14.2
52 silly extract runas@3.1.1
53 silly tarball trying nan@2.x by hash: sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==
54 silly tarball trying runas@latest by hash: sha1-Ut1TjbDkF0U5lTWjRwkbpFzA6rA=
55 silly extract runas@latest extracted to /usr/local/lib/node_modules/.staging/runas-721cadaf (64ms)
56 silly extract nan@2.x extracted to /usr/local/lib/node_modules/.staging/nan-d05e9b07 (86ms)
57 timing action:extract Completed in 89ms
58 silly doReverseSerial unbuild 16
59 silly doSerial remove 16
60 silly doSerial move 16
61 silly doSerial finalize 16
62 silly finalize /usr/local/lib/node_modules/runas/node_modules/nan
63 silly finalize /usr/local/lib/node_modules/runas
64 timing action:finalize Completed in 15ms
65 silly doParallel refresh-package-json 2
66 silly refresh-package-json /usr/local/lib/node_modules/runas/node_modules/nan
67 silly refresh-package-json /usr/local/lib/node_modules/runas
68 timing action:refresh-package-json Completed in 30ms
69 silly doParallel preinstall 2
70 silly preinstall nan@2.14.2
71 info lifecycle nan@2.14.2~preinstall: nan@2.14.2
72 silly preinstall runas@3.1.1
73 info lifecycle runas@3.1.1~preinstall: runas@3.1.1
74 timing action:preinstall Completed in 2ms
75 silly doSerial build 16
76 silly build nan@2.14.2
77 info linkStuff nan@2.14.2
78 silly linkStuff nan@2.14.2 has /usr/local/lib/node_modules/runas/node_modules as its parent node_modules
79 silly linkStuff nan@2.14.2 is part of a global install
80 silly linkStuff nan@2.14.2 is installed into a global node_modules
81 silly build runas@3.1.1
82 info linkStuff runas@3.1.1
83 silly linkStuff runas@3.1.1 has /usr/local/lib/node_modules as its parent node_modules
84 silly linkStuff runas@3.1.1 is part of a global install
85 silly linkStuff runas@3.1.1 is installed into a global node_modules
86 silly linkStuff runas@3.1.1 is installed into the top-level global node_modules
87 timing action:build Completed in 1ms
88 silly doSerial global-link 16
89 silly doParallel update-linked 0
90 silly doSerial install 16
91 silly install nan@2.14.2
92 info lifecycle nan@2.14.2~install: nan@2.14.2
93 silly install runas@3.1.1
94 info lifecycle runas@3.1.1~install: runas@3.1.1
95 verbose lifecycle runas@3.1.1~install: unsafe-perm in lifecycle true
96 verbose lifecycle runas@3.1.1~install: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/local/lib/node_modules/runas/node_modules/.bin:/usr/local/lib/node_modules/.bin:/usr/local/bin:/usr/local/php5/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/usr/local/php5/bin
97 verbose lifecycle runas@3.1.1~install: CWD: /usr/local/lib/node_modules/runas
98 silly lifecycle runas@3.1.1~install: Args: [ '-c', 'node-gyp rebuild' ]
99 silly lifecycle runas@3.1.1~install: Returned: code: 1  signal: null
100 info lifecycle runas@3.1.1~install: Failed to exec install script
101 timing action:install Completed in 6716ms
102 verbose unlock done using /Users/macbook/.npm/_locks/staging-3a08f0df5026584d.lock for /usr/local/lib/node_modules/.staging
103 timing stage:rollbackFailedOptional Completed in 41ms
104 timing stage:runTopLevelLifecycles Completed in 7275ms
105 verbose stack Error: runas@3.1.1 install: `node-gyp rebuild`
105 verbose stack Exit status 1
105 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
105 verbose stack     at EventEmitter.emit (events.js:315:20)
105 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
105 verbose stack     at ChildProcess.emit (events.js:315:20)
105 verbose stack     at maybeClose (internal/child_process.js:1048:16)
105 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
106 verbose pkgid runas@3.1.1
107 verbose cwd /Users/macbook/Desktop/VPNMaze
108 verbose Darwin 19.2.0
109 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "runas"
110 verbose node v14.15.0
111 verbose npm  v6.14.8
112 error code ELIFECYCLE
113 error errno 1
114 error runas@3.1.1 install: `node-gyp rebuild`
114 error Exit status 1
115 error Failed at the runas@3.1.1 install script.
115 error This is probably not a problem with npm. There is likely additional logging output above.
116 verbose exit [ 1, true ]```