【问题标题】:Firebase CLI commands do not work with VS Code Git Bash TerminalFirebase CLI 命令不适用于 VS Code Git Bash 终端
【发布时间】:2020-10-03 07:26:00
【问题描述】:

我已安装 npm 并重新安装了 firebase-tools(全局),但是当通过 GitBash 在 VS Code 终端中工作时,我在任何 firebase 命令上都收到此错误:

C:\Users\{user}\AppData\Roaming\npm/node_modules/node/bin/node: line 1: This: command not found

通过 VS Code 或独立使用命令行或 PowerShell 时,我仅在使用 Git Bash 时没有收到此错误。当我将.cmd 添加到firebase 时不会发生此错误。

firebase --version = error  
firebase.cmd --version = 8.4.2

如果有人能解释为什么会发生这种情况,我将不胜感激。我不介意使用 PowerShell,但我想知道这个错误背后的“原因”。

版本:
VS 代码 1.46.0
Firebase 8.4.2
npm 6.14.4
混帐 2.27.0

操作系统是 Windows 10。

【问题讨论】:

    标签: firebase powershell visual-studio-code command-line-interface git-bash


    【解决方案1】:

    试试这个

    npm uninstall firebase-tools
    npm cache clean --force
    

    如果这不起作用,那么您应该物理删除 C:/Users/{username}/AppData/Roaming/npmC:/Users/{username}/AppData/Roaming/npm-cache 并重新安装全局 npm 模块。

    关于此error 存在一个未解决的问题,与您的错误类似。

    【讨论】:

      猜你喜欢
      • 2022-01-19
      • 2016-08-13
      • 2021-04-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-13
      • 2022-12-21
      • 1970-01-01
      相关资源
      最近更新 更多