我有一个 Angular 项目,我在构建项目后尝试使用 firebase deploy
。在“托管:准备 dist 目录进行上传”之后,它失败并出现以下错误。
WARNING: You are likely using a version of node-tar or npm that is incompatible with this version of Node.js. Please use either the version of npm that is bundled with Node.js, or a version of npm (> 5.5.1 or < 5.4.0) or node-tar (> 4.0.1) that is compatible with Node.js 9 and above. node[38453]: ../src/node_zlib.cc:437:static void node::(anonymous namespace)::ZCtx::Init(const FunctionCallbackInfo &): Assertion `args.Length() == 7 && "init(windowBits, level, memLevel, strategy, writeResult, writeCallback," " dictionary)"' failed. 1: node::Abort() [/usr/local/bin/node] 2: node::Assert(char const* const () [4]) [/usr/local/bin/node] 3: node::(anonymous namespace)::ZCtx::Init(v8::FunctionCallbackInfo const&) [/usr/local/bin/node] 4: v8::internal::FunctionCallbackArguments::Call(void ()(v8::FunctionCallbackInfo const&)) [/usr/local/bin/node] 5: v8::internal::MaybeHandle v8::internal::(anonymous namespace)::HandleApiCallHelper(v8::internal::Isolate*, v8::internal::Handle, v8::internal::Handle, v8::internal::Handle, v8::internal::Handle, v8::internal::BuiltinArguments) [/usr/local/bin/node] 6: v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) [/usr/local/bin/node] 7: 0x3e504a2842fd Abort trap: 6
我检查了我的 Node (v.9.6.1) 和 npm (5.6.0) 版本。我尝试删除 node 和 npm 并重新安装它们,但没有成功。我一直无法找到node-tar 版本。
如果有人能帮助我指明正确的方向,我将非常感激。
最佳答案
嘿伙计,我刚刚遇到了这个问题。将 node 和 npm 升级到最新版本后,我认为它来自 firebase cli。
我只是npm install -g firebase-tools
,然后firebase部署
又开始工作了!
关于node.js - Firebase:node-tar 或 npm 与此版本的 Node.js 不兼容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48963549/