Node.js npm安装grpc失败

Node.js npm安装grpc失败,node.js,npm,grpc,Node.js,Npm,Grpc,开始由npm安装grpc,我遇到一些错误 npm安装-g grpc 错误: enviroment: node version v8.9.3 npm >5.x gyp ERR!构建错误 哎呀!堆栈错误:`make`失败,退出代码:2 哎呀!ChildProcess.onExit处的堆栈 (/Users/yuham/.nvm/versions/node/v8.9.3/lib/node_modules/node- gyp/lib/build.js:258:23) 哎呀!在emitTwo处堆栈(

开始由npm安装grpc,我遇到一些错误
npm安装-g grpc

错误:

enviroment: node version v8.9.3 npm >5.x
gyp ERR!构建错误
哎呀!堆栈错误:`make`失败,退出代码:2
哎呀!ChildProcess.onExit处的堆栈
(/Users/yuham/.nvm/versions/node/v8.9.3/lib/node_modules/node-
gyp/lib/build.js:258:23)
哎呀!在emitTwo处堆栈(events.js:126:13)
哎呀!ChildProcess.emit处的堆栈(events.js:214:7)
哎呀!在Process.ChildProcess.\u handle.onexit处堆栈
(内部/子进程js:198:12)
哎呀!达尔文系统17.2.0
...
哎呀!cwd/Users/yuham/.nvm/versions/node/v8.9.3/lib/node_modules/grpc
哎呀!节点-v v8.9.3
哎呀!节点gyp-v3.6.2
哎呀!不好
节点前gyp错误!构建错误
节点前gyp错误!堆栈错误:无法执行
...
节点前gyp错误!在子进程中进行堆栈。
(/Users/yuham/.nvm/versions/node/v8.9.3/lib/node_模块/
grpc/节点\模块/节点-
pre-gyp/lib/util/compile.js:83:29)
节点前gyp错误!在emitTwo处堆栈(events.js:126:13)
节点前gyp错误!ChildProcess.emit处的堆栈(events.js:214:7)
节点前gyp错误!maybeClose的堆栈(内部/子进程js:925:16)
节点前gyp错误!在Process.ChildProcess.\u handle.onexit处堆栈
(内部/子流程js:209:5)
节点前gyp错误!达尔文系统17.2.0
节点前gyp错误!命令“/Users/yuham/.nvm/versions/node/v8.9.3/bin/node”
“/Users/yuham/.nvm/versions/node/v8.9.3/lib/node_模块/
grpc/node_modules/.bin/node pre gyp“安装”--回退到生成--
库=静态库“
节点前gyp错误!cwd
/Users/yuham/.nvm/versions/node/v8.9.3/lib/node_modules/grpc
节点前gyp错误!节点-v v8.9.3
节点前gyp错误!gyp前节点-v v0.6.38
节点前gyp错误!不好
无法执行“/Users/yuham/.nvm/versions/node/v8.9.3/bin/node”
/Users/yuham/.nvm/versions/node/v8.9.3/lib/node_modules/node-gyp/bin/node-
gyp.js build--回退到build--library=static\u library--
module=/Users/yuham/.nvm/versions/node/v8.9.3/lib/node_modules/
grpc/src/node/extension_binary/node-v57-darwin-x64/grpc_node.node--
模块名称=grpc节点--
module_path=/Users/yuham/.nvm/versions/node/v8.9.3/lib/node_modules/
grpc/src/node/extension_binary/node-v57-darwin-x64'(1)
npm错误!代码失效循环
npm错误!错误1
npm错误!grpc@1.6.6install:`node pre-gyp install--回退到构建--
库=静态库`
npm错误!退出状态1
npm错误!
npm错误!失败grpc@1.6.6安装脚本。
npm错误!这可能不是npm的问题。可能还有其他的问题
上面的日志输出。
npm错误!此运行的完整日志可在以下位置找到:
我尝试安装不同版本的grpc,但得到了相同的结果
而这个错误是由节点前gyp还是节点gyp引起的?我的计算机系统是osx--lts。我找不到任何好主意或解决办法。如何修复它?

运行此命令,它将正常工作

gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit 
(/Users/yuham/.nvm/versions/node/v8.9.3/lib/node_modules/node-
gyp/lib/build.js:258: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.2.0
...
gyp ERR! cwd /Users/yuham/.nvm/versions/node/v8.9.3/lib/node_modules/grpc
gyp ERR! node -v v8.9.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 
...
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> 
(/Users/yuham/.nvm/versions/node/v8.9.3/lib/node_modules/
grpc/node_modules/node-
pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:925:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit 
(internal/child_process.js:209:5)
node-pre-gyp ERR! System Darwin 17.2.0
node-pre-gyp ERR! command "/Users/yuham/.nvm/versions/node/v8.9.3/bin/node" 
"/Users/yuham/.nvm/versions/node/v8.9.3/lib/node_modules/
grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--
library=static_library"
node-pre-gyp ERR! cwd 
/Users/yuham/.nvm/versions/node/v8.9.3/lib/node_modules/grpc
node-pre-gyp ERR! node -v v8.9.3
node-pre-gyp ERR! node-pre-gyp -v v0.6.38
node-pre-gyp ERR! not ok
Failed to execute '/Users/yuham/.nvm/versions/node/v8.9.3/bin/node 
/Users/yuham/.nvm/versions/node/v8.9.3/lib/node_modules/node-gyp/bin/node-
gyp.js build --fallback-to-build --library=static_library --
module=/Users/yuham/.nvm/versions/node/v8.9.3/lib/node_modules/
grpc/src/node/extension_binary/node-v57-darwin-x64/grpc_node.node --
module_name=grpc_node --
module_path=/Users/yuham/.nvm/versions/node/v8.9.3/lib/node_modules/
grpc/src/node/extension_binary/node-v57-darwin-x64' (1)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc@1.6.6 install: `node-pre-gyp install --fallback-to-build --
library=static_library`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the grpc@1.6.6 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:

但是我不明白“不安全烫发”是什么意思?

我发现问题在于包
请求
丢失了。 在安装grpc之前安装它修复了我的问题。 如果您的软件包取决于
grpc
,请先安装
request

纱线添加请求

纱线添加grpc


一位同事提到了一些关于公司代理的事情。不知道这是否真的是问题所在,但添加
request
确实解决了问题。

也许可以尝试更新节点gyp。这个包有时会很麻烦。@Frederik.L我将节点gyp node pre-gyp更新为lts-vesion,但错误相同
npm install -g xxx --unsafe-perm