Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用npm安装firebase时,gyp和节点预gyp失败_Firebase_Npm_Gyp - Fatal编程技术网

使用npm安装firebase时,gyp和节点预gyp失败

使用npm安装firebase时,gyp和节点预gyp失败,firebase,npm,gyp,Firebase,Npm,Gyp,我正在尝试使用npm安装依赖项,但当firebase安装时,安装失败。我尝试使用npm I firebase单独安装firebase,但它不起作用。我删除了node_modules文件夹,清理了缓存并再次安装,但它也不起作用 npm向我显示的第一个错误是下载grpc预编译二进制文件时的403错误代码。我认为这是主要问题,这取决于下一个错误,但我不确定。有人能告诉我如何使用npm成功安装firebase吗 输出: node-pre-gyp ERR! Tried to download(403):

我正在尝试使用npm安装依赖项,但当firebase安装时,安装失败。我尝试使用
npm I firebase
单独安装firebase,但它不起作用。我删除了node_modules文件夹,清理了缓存并再次安装,但它也不起作用

npm向我显示的第一个错误是下载grpc预编译二进制文件时的403错误代码。我认为这是主要问题,这取决于下一个错误,但我不确定。有人能告诉我如何使用npm成功安装firebase吗

输出:

node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.7.2/node-v57-linux-x64-musl.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for grpc@1.7.2 and node@8.5.0 (node-v57 ABI, musl) (falling back to source compile with node-gyp) 
node-pre-gyp http 403 status code downloading tarball https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.7.2/node-v57-linux-x64-musl.tar.gz 
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@8.5.0 | linux | x64
gyp info ok 
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@8.5.0 | linux | x64
gyp ERR! configure error 
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (/app/node_modules/node-gyp/lib/configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/app/node_modules/node-gyp/lib/configure.js:397:16)
gyp ERR! stack     at F (/app/node_modules/which/which.js:68:16)
gyp ERR! stack     at E (/app/node_modules/which/which.js:80:29)
gyp ERR! stack     at /app/node_modules/which/which.js:89:16
gyp ERR! stack     at /app/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /app/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:153:21)
gyp ERR! System Linux 4.4.0-101-generic
gyp ERR! command "/usr/local/bin/node" "/app/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=/app/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-musl/grpc_node.node" "--module_name=grpc_node" "--module_path=/app/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-musl"
gyp ERR! cwd /app/node_modules/grpc
gyp ERR! node -v v8.5.0
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 '/usr/local/bin/node /app/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --library=static_library --module=/app/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-musl/grpc_node.node --module_name=grpc_node --module_path=/app/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-musl' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/app/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:125:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:927:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Linux 4.4.0-101-generic
node-pre-gyp ERR! command "/usr/local/bin/node" "/app/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /app/node_modules/grpc
node-pre-gyp ERR! node -v v8.5.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/bin/node /app/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --library=static_library --module=/app/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-musl/grpc_node.node --module_name=grpc_node --module_path=/app/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-musl' (1)
npm info lifecycle grpc@1.7.2~install: Failed to exec install script
npm WARN codelyzer@3.2.2 requires a peer of @angular/compiler@^2.3.1 || >=4.0.0-beta <5.0.0 but none was installed.
npm WARN codelyzer@3.2.2 requires a peer of @angular/core@^2.3.1 || >=4.0.0-beta <5.0.0 but none was installed.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc@1.7.2 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.7.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
节点前gyp错误!已尝试下载(403):https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.7.2/node-v57-linux-x64-musl.tar.gz 
节点前gyp错误!找不到的预构建二进制文件grpc@1.7.2及node@8.5.0(node-v57 ABI,musl)(使用node-gyp返回到源代码编译)
节点前gyp http 403状态代码下载tarballhttps://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.7.2/node-v57-linux-x64-musl.tar.gz 
gyp信息如果以ok结尾,它就起作用了
gyp信息使用节点-gyp@3.6.2
gyp信息使用node@8.5.0| linux | x64
gyp信息正常
gyp信息如果以ok结尾,它就起作用了
gyp信息使用节点-gyp@3.6.2
gyp信息使用node@8.5.0| linux | x64
哎呀!配置错误
哎呀!堆栈错误:找不到Python可执行文件“Python”,可以设置Python env变量。
哎呀!在PythonFinder.failNoPython(/app/node_modules/node gyp/lib/configure.js:483:19)处堆栈
哎呀!堆叠在PythonFinder。(/app/node_modules/node gyp/lib/configure.js:397:16)
哎呀!堆栈位于F(/app/node_modules/which/which.js:68:16)
哎呀!堆栈位于E(/app/node_modules/which/which.js:80:29)
哎呀!堆栈位于/app/node_modules/which/which.js:89:16
哎呀!堆栈位于/app/node_modules/isexe/index.js:42:5
哎呀!堆栈位于/app/node_modules/isexe/mode.js:8:5
哎呀!堆栈在FSReqWrap.oncomplete(fs.js:153:21)
哎呀!Linux系统4.4.0-101-generic
哎呀!命令“/usr/local/bin/node”“/app/node\u modules/node gyp/bin/node gyp.js”“configure”“--构建回退”“--库=静态库”“--模块=/app/node\u modules/grpc/src/node/extension\u binary/node-v57-linux-x64-musl/grpc\u node.node”“--模块名称=grpc\u节点”“--模块路径=/app/node\u modules/grpc/src/node/extension\node-v57-linux-x64-musl”
哎呀!cwd/app/node_模块/grpc
哎呀!节点-v v8.5.0
哎呀!节点gyp-v3.6.2
哎呀!不好
节点前gyp错误!构建错误
节点前gyp错误!堆栈错误:未能执行“/usr/local/bin/node/app/node_modules/node gyp/bin/node-gyp.js configure--fallback to build--library=static_library--module=/app/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-musl/grpc_node.node--module_name=grpc_node--module_path=/app/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-musl'(1)
节点前gyp错误!在子进程中进行堆栈。(/app/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
节点前gyp错误!在emitTwo处堆栈(events.js:125:13)
节点前gyp错误!ChildProcess.emit上的堆栈(events.js:213:7)
节点前gyp错误!maybeClose的堆栈(内部/child_process.js:927:16)
节点前gyp错误!在Process.ChildProcess.\u handle.onexit(internal/child\u Process.js:211:5)处堆栈
节点前gyp错误!Linux系统4.4.0-101-generic
节点前gyp错误!命令“/usr/local/bin/node”“/app/node\u modules/grpc/node\u modules/.bin/node-pre-gyp”“安装”“--回退以生成”“--库=静态库”
节点前gyp错误!cwd/app/node_模块/grpc
节点前gyp错误!节点-v v8.5.0
节点前gyp错误!gyp前节点-v v0.6.39
节点前gyp错误!不好
无法执行“/usr/local/bin/node/app/node_modules/node gyp/bin/node-gyp.js configure--fallback to build--library=static_library--module=/app/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-musl/grpc_node--modules--module modules路径=/app/node/node/node/node-linux-x64-musl”
npm信息生命周期grpc@1.7.2~install:无法执行安装脚本
npm警告codelyzer@3.2.2需要@angular/compiler@^2.3.1||>=4.0.0-beta=4.0.0-beta=4.0.0-beta=4.0.0-beta更新:

这个答案让我可以在我的alpine容器中启动并运行我的应用程序。尝试在开发环境中运行此代码。希望这有帮助

今天早上遇到了同样的问题。似乎还没有为基于musl的发行版上载预编译的grpc1.7.2(alpine是musl vs glibc)

短期来说,为了让构建重新开始,在他们上传预编译版本之前,请尝试将其添加到dockerfile中

 apk update && apk upgrade &&
   apk add --no-cache python make g++
python、make和g++基本上允许节点gyp从源代码处编译,而不是依赖预编译版本


我在创建docker映像时遇到了相同的问题。我注意到,在使用LinuxAlpine节点基础映像时,我遇到了这个错误。然而,
当使用标准节点(我认为Ubuntu14.04)基本映像时,它工作得很好。你在用什么操作系统?我希望你能找到解决办法

谢谢,现在很好用。我的主要操作系统是Ubuntu,但我的容器有alpine。
 apk update && apk upgrade &&
   apk add --no-cache python make g++