我一次又一次地收到同样的错误。我尝试安装不同的npm版本,甚至将Ubuntu更新到18.04,但都没有成功。我用来安装的命令是
npm install -g composer-cli@0.19
我得到的错误是:
gyp ERR!节点-v v11.3.0
gyp ERR!节点gyp-v v3.8.0
gyp ERR!不正常
节点预处理错误!生成错误
节点预处理错误!堆栈错误:无法执行'/home/akshay/.nvm/versions/node/v1.3.0/bin/node/home/akshay/.nvm/versions/node/v1.3.0/lib/node_modules/npm/node_modeles/node-gyp/bin/node-gyp.jsbuild--回退到build--library=static_library--模块=/home/akshay/.nvm/versions/node/v1.3.0/lib/node_modules/composer-cli/node_modeles/grpc/src/node/extension_binary/node-v67-linux-x64-glibc/grpc_node.node--模块名称=grpc_node--模块路径=/home/akshay/.nvm/versions/note/v1.3.0/lib/node_modules/compooser cli/node_modeles/grpc/src/node/extension_binary/node-v67-linux-x64-glibc'(1)
节点预处理错误!在ChildProcess中堆叠。(/home/akshay/.nvm/versions/note/v1.3.0/lib/node_modules/compooser cli/node_modeles/grpc/node_modules/node pre-gyp/lib/util/compile.js:83:29)
节点预处理错误!ChildProcess.emit的堆栈(events.js:182:13)
节点预处理错误!maybeClose处的堆栈(internal/child_process.js:978:16)
节点预处理错误!Process.ChildProcess.handle.onext处的堆栈(internal/child_process.js:265:5)
节点预处理错误!系统Linux 4.15.0-39通用
节点预处理错误!命令"/home/akshay/.nvm/versions/note/v1.3.0/bin/node"/home/akshay/.nvm/versions/note/v1.3.0/lib/node_modules/comporter cli/node_modeles/grpc/node_modules/.bin/node-pre-gip"install"--回退到生成"--library=static_library">
节点预处理错误!cwd/home/akshay/.nvm/versions/node/v1.3.0/lib/node_modules/composer-cli/node_modeles/grpc-
节点预处理错误!节点-v v11.3.0
节点预处理错误!节点预处理程序-v v0.7.0
节点预处理错误!不正常
无法执行'/home/akshay/.nvm/versions/note/v1.3.0/bin/node/home/akshay/.nvm/versions/node/v1.3.0/lib/node_modules/npm/node_modeles/node-gyp/bin/node-gyp.jsbuild--回退到build--library=static_library--模块=/home/akshay/.nvm/versions/node/v1.3.0/lib/node_modules/composer-cli/node_modeles/grpc/src/node/extension_binary/node-v67-linux-x64-glibc/grpc_node.node--模块名称=grpc_node--模块路径=/home/akshay/.nvm/versions/note/v1.3.0/lib/node_modules/compooser cli/node_modeles/grpc/src/node/extension_binary/node-v67-linux-x64-glibc'(1)
CXX(目标)发布/obj.target/grpc/des/grpc/src/core/lib/backoff/backoff.oe
CXX(目标)发布/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_args.o
CXX(目标)发布/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack.o
CXX(目标)发布/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack_builder.o
在包含的文件中../deps/grpc/src/core/lib/channel/channel_stack_builder.h:24:0,
来自/deps/grpc/src/core/lib/channel/channel_stack_builder.cc:19:
/deps/grpc/src/core/lib/channel/channel_args.h:22:10:致命错误:grpc/compression.h:没有这样的文件或目录
编译终止。
grpc.target.mk:394:目标配方'发布/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack_builder.o'失败
制造商:***[发布/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack_builder.o]错误1
make:离开目录'/home/akshay/.nvm/versions/node/v1.3.0/lib/node_modules/comporter cli/node_modeles/grpc/build'
gyp ERR!生成错误
gyp ERR!堆栈错误:make失败,退出代码:2
gyp ERR!在ChildProcess.onExit处堆叠(/home/akshay/.nvm/versions/note/v1.3.0/lib/node_modules/npm/node_mdules/node-gyp/lib/build.js:262:23)gyp ERR!ChildProcess.emit的堆栈(events.js:182:13)
gyp ERR!Process.ChildProcess.handle.onext处的堆栈(internal/child_process.js:254:12)
gyp ERR!系统Linux 4.15.0-39通用
gyp ERR!命令"/home/akshay/.nvm/versions/note/v1.3.0/bin/node"/home/akshay/.nvm/versions/note/v1.3.0/lib/node_modules/npm/node_models/node-gyp/bin/node-gyp.js"build"--回退到build"--library=static_library"--模块=/home/akshay/.nvm/versions/note/v1.3.0/lib/node_modules/comporter cli/node_modeles/grpc/src/node/extension_binary/node-v67-linux-x64-glibc/grpc_node.node"--模块名称=grpc_node"--module_path=/home/akshay/.nvm/versions/note/v1.3.0/lib/node_modules/comporter cli/node_modeles/grpc/src/node/extension_binary/node-v67-linux-x64-glibc">
gyp ERR!cwd/home/akshay/.nvm/versions/node/v1.3.0/lib/node_modules/composer-cli/node_modeles/grpc-
gyp ERR!节点-v v11.3.0
gyp ERR!节点gyp-v v3.8.0
gyp ERR!不正常
npm警告可选跳过可选依赖性:fsevents@1.2.4(node_modules/compooser cli/node_modules/fsevents):
npm警告不支持跳过可选依赖项:不支持的平台对于fsevents@1.2.4:wanted{"os":"darwin","arch":"any"}(当前:{"os":"linux","arch":"x64"})`
`npm ERR!代码ELIFECYCLE
npm ERR!错误1
npm ERR!grpc@1.10.1安装:节点预gyp安装--回退到生成--library=static_librarynpm ERR!退出状态1
npm ERR!
npm ERR!在处失败grpc@1.10.1安装脚本。
npm ERR!这可能不是npm的问题。很可能上面的附加日志输出。
npm ERR!此运行的完整日志可在以下位置找到:
npm ERR
/home/akshay/.npm/_logs/2018-11-29T02_27_29_404Z-debug.log
当您使用nvm时,这是管理节点的推荐方式,它很容易切换到不同版本的节点,请发出以下命令
nvm install 8
nvm use 8
现在正常安装composer。
完全删除当前版本的节点,并尝试安装节点8.x版本。
有关删除节点版本,请参阅:完全删除节点
用于安装节点8.x版本:
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
然后尝试安装npm install -g composer-cli@0.19
只需重新安装npm
sudo npm uninstall npm -g
sudo apt update
sudo apt intall npm