我正在构建一个有角度的Firebase web应用程序,由于一些复杂的查询,我开始从Firebase中寻找云函数。
我的项目看起来像:
MyProject
|__ node_modules
|__ src (with app and my complete project)
|__ some files like tsconfig.json
我遵循了经典教程:https://firebase.google.com/docs/functions/get-started
MyProject
|__ node_modules
|__ src (with app and my complete project)
|__ some files like tsconfig.json
|__ functions
|__ node_modules
|__ src
但是使用Firebase部署仅功能时的问题:
i deploying functions
Running command: npm --prefix "%RESOURCE_DIR%" run lint
> functions@ lint E:\Travail\wamp64\www\WhoAmI\WhoAmI\functions
> tslint --project tsconfig.json
Running command: npm --prefix "%RESOURCE_DIR%" run build
> functions@ build E:\Travail\wamp64\www\WhoAmI\WhoAmI\functions
> tsc
../node_modules/@types/jquery/index.d.ts(191,29): error TS2304: Cannot find name 'XMLHttpRequest'.
../node_modules/@types/jquery/index.d.ts(512,41): error TS2304: Cannot find name 'Event'.
../node_modules/@types/jquery/index.d.ts(517,20): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(527,21): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(552,20): error TS2304: Cannot find name 'Event'.
../node_modules/@types/jquery/index.d.ts(562,20): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(582,13): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(944,34): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(952,15): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(960,20): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(999,36): error TS2304: Cannot find name 'Document'.
../node_modules/@types/jquery/index.d.ts(1046,22): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(1054,19): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(1061,19): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(1070,22): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(1078,22): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(1087,20): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(1096,20): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(1105,20): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(1114,25): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(1191,25): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(1191,45): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(1309,32): error TS2304: Cannot find name 'Window'.
../node_modules/@types/jquery/index.d.ts(1316,20): error TS2304: Cannot find name 'Node'.
../node_modules/@types/jquery/index.d.ts(1378,29): error TS2304: Cannot find name 'XMLDocument'.
../node_modules/@types/jquery/index.d.ts(1402,22): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(1412,39): error TS2304: Cannot find name 'HTMLElement'.
../node_modules/@types/jquery/index.d.ts(1422,39): error TS2304: Cannot find name 'Document'.
../node_modules/@types/jquery/index.d.ts(1437,70): error TS2304: Cannot find name 'XMLHttpRequest'.
../node_modules/@types/jquery/index.d.ts(1472,69): error TS2304: Cannot find name 'XMLHttpRequest'.
../node_modules/@types/jquery/index.d.ts(1482,115): error TS2304: Cannot find name 'XMLHttpRequest'.
../node_modules/@types/jquery/index.d.ts(3075,14): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3119,34): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3119,42): error TS2304: Cannot find name 'DocumentFragment'.
../node_modules/@types/jquery/index.d.ts(3119,59): error TS2304: Cannot find name 'Text'.
../node_modules/@types/jquery/index.d.ts(3126,57): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3135,35): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3135,43): error TS2304: Cannot find name 'DocumentFragment'.
../node_modules/@types/jquery/index.d.ts(3135,60): error TS2304: Cannot find name 'Text'.
../node_modules/@types/jquery/index.d.ts(3142,58): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3150,35): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3159,35): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3159,43): error TS2304: Cannot find name 'DocumentFragment'.
../node_modules/@types/jquery/index.d.ts(3159,60): error TS2304: Cannot find name 'Text'.
../node_modules/@types/jquery/index.d.ts(3166,58): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3197,38): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3197,46): error TS2304: Cannot find name 'Text'.
../node_modules/@types/jquery/index.d.ts(3205,39): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3205,47): error TS2304: Cannot find name 'Text'.
../node_modules/@types/jquery/index.d.ts(3214,36): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3214,44): error TS2304: Cannot find name 'DocumentFragment'.
../node_modules/@types/jquery/index.d.ts(3214,61): error TS2304: Cannot find name 'Text'.
../node_modules/@types/jquery/index.d.ts(3221,59): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3229,36): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3245,37): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3253,42): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3253,50): error TS2304: Cannot find name 'Text'.
../node_modules/@types/jquery/index.d.ts(3260,29): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3287,16): error TS2304: Cannot find name 'HTMLElement'.
../node_modules/@types/jquery/index.d.ts(3301,34): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3316,37): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3331,39): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3346,38): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3354,25): error TS2304: Cannot find name 'HTMLElement'.
../node_modules/@types/jquery/index.d.ts(3360,12): error TS2304: Cannot find name 'HTMLElement'.
../node_modules/@types/jquery/index.d.ts(3373,35): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3386,22): error TS2304: Cannot find name 'HTMLElement'.
../node_modules/@types/jquery/index.d.ts(3395,37): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3402,22): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3440,41): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3454,22): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3463,39): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3498,43): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3505,21): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3527,19): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3555,20): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3570,39): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3598,47): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3631,25): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3654,40): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3661,19): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3661,27): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3707,28): error TS2304: Cannot find name 'Element'.
../node_modules/@types/jquery/index.d.ts(3748,25): error TS2304: Cannot find name 'Element'.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! functions@ build: `tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the functions@ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
任何想法?我做错什么了吗?
版本:“firebase”:“^5.0.4”firebase函数“^2.0.3”firebase管理“~6.0.0”firebase CLI:4.2。1.
角度项目和函数项目应位于不同的文件夹中。现在,您将它们组合在一起,Firebase CLI正在尝试将web代码lint并部署到云功能,这是行不通的。
将您的两个节点项目完全分开,它们之间没有重叠,因为它们彼此独立运行:
MyProject
/angular
/src
/node_modules
/functions
/src
/node_modules
我是angular 2和typescript的新手,正在尝试为我的弹出窗口调用RocketLaunch函数。 如果我在弹出窗口外声明它不调用,但如果我在弹出窗口内移动它抛出此错误: 错误TS2304:找不到名称“$event” 提供以下相关代码和错误:
我已经使用firebase云函数一段时间了,今天在代码中修复了一个小错误,在尝试部署时出现了以下错误。我取消了该更改,并尝试使用上次提交的稳定更改再次部署,但仍然是相同的错误。有什么解决办法吗?PS:这是一个typescript项目,我用tsc编译它。
我的包裹。json就是这样。 我的index.js是 你能告诉我密码有什么问题吗?提前谢谢。
我试图启动并运行我的第一个TypeScript和DefinitelyTyped Node.js应用程序,但遇到了一些错误。 当我尝试传输一个简单的TypeScript node.js页面时,我收到错误“TS2304:无法找到名称'require'”。我已经阅读了其他几次发生在Stack ;溢出上的此错误,我认为我没有类似的问题。我正在shell提示符下运行命令: 该文件的内容为: 在行上抛出错误。
问题内容: 我正在尝试启动并运行我的第一个TypeScript和DefinitelyTyped Node.js应用程序,并且遇到一些错误。 尝试转换简单的TypeScript Node.js页面时,出现错误“ TS2304:找不到名称’require’”。我已经阅读了Stack Overflow上多次出现此错误的信息,但我认为我没有类似的问题。我在shell提示符下运行命令: 该文件的内容是: 错
问题内容: 我正在尝试使用TypeScript在NodeJS中进行base64编码。 以下代码在JavaScript中可以正常工作。 当我在TypeScript中编写相同的内容并进行编译时,我得到Buffer is not found错误。 有人可以帮我在TypeScript中做同样的事情。 问题答案: 在顶部添加以下行: 它应该编译没有错误。 使用内置于库或其他全局对象中的节点需要声明,您可以像