小编Mhd*_*Mhd的帖子

类型“typeof globalThis”没有索引签名

每当我尝试在 TypeScript 环境中向全局 Nodejs 全局 namspace 添加函数时,都会收到此错误。

元素隐式具有“any”类型,因为类型“typeof globalThis”没有索引签名

声明全局命名空间

declare global {
  namespace NodeJS {
    interface Global {
      signin(): string[]
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

所以如果我尝试这个

global.signin = () => {}
Run Code Online (Sandbox Code Playgroud)

它返回一个

元素隐式具有“any”类型,因为类型“typeof globalThis”没有索引签名

node.js typescript microservices

62
推荐指数
6
解决办法
5万
查看次数

我的本地 git 存储库在 git 远程引用了超过 1 个应用程序。我无法推送到heroku

我无法将我的应用程序部署到heroku。git Remote 中的多个应用程序。我该如何解决这个问题?

    Error: Multiple apps in git remotes
    Usage: --remote origin
    or: --app arcane-scrubland-65909
    Your local git repository has more than 1 app referenced in git 
    remotes.
    Because of this, we can't determine which app you want to run this 
    command against.
    Specify the app you want with --app or --remote.
    Heroku remotes in repo:
    secure-badlands-61058 (heroku)
    arcane-scrubland-65909 (origin)
Run Code Online (Sandbox Code Playgroud)

git heroku

5
推荐指数
1
解决办法
4456
查看次数

标签 统计

git ×1

heroku ×1

microservices ×1

node.js ×1

typescript ×1