我有两个类型记录/节点项目,都使用相同版本的节点。然而,当我在每个项目中使用import * as Crypto from 'crypto';时,它们指向两个不同版本的密码模块:
我对node和javascript / typescript非常陌生,并且很难理解其中的原因,希望有人能给我启发。我的问题是:为什么import * as Crypto from 'crypto';要解决两个不同版本的密码,即使项目设置使用相同的版本(我认为!)?什么决定使用内置模块的哪个版本?我如何解决这一问题,使两者使用相同的?
这是我的装置:
===Project 1
我使用的是firebase云函数,使用的是类型记录,每件事情都很好。在我的代码中,我创建了一个类型为DocumentReference和GeoPoint的变量,它使vs代码导入它
import { GeoPoint, DocumentReference } from '@google-cloud/firestore'
function offsetSlightly(location:GeoPoint) {
//some code here
return new GeoPoint(latitude, longitude)
}
因此,我需要添加使用命令添加的节点模块。
我在云函数上使用了firebase云函数和javascript。而且,我想从javascript切换到typescript。
但是,我不能在typescript上使用firebase-admin,因为以下命令失败。
command: npm install @types/firebase-admin --save-dev
error: '@types/firebase-admin' is not in the npm registry.
根据此发行说明,firebase管理员似乎支持typescript。谁能告诉我们如何在云函数上使用typescript和firebase-a
我在部署firebase云函数时遇到以下错误。这是在将firebase-tool和npm升级到最新版本之后发生的。 node_modules/geofirestore/dist/GeoFirestoreTypes.ts:3:10 - error TS2614:
Module
'"**/flutter/project123/functions/node_modules/geofirestore/node_modules/firebase"' has no exported member 'firestore'.
Did you mean t
我正在为我的web项目使用firebase。尤其是在服务器端。我跟踪了官方的医生。
和它说过,
// Firebase App (the core Firebase SDK) is always required and
// must be listed before other Firebase SDKs
import * as firebase from "firebase/app";
// Add the Firebase services that you want to use
import "firebase/auth";
import "
我正在实现角通用服务器端呈现到一个现有的角7应用程序。我还试图让它与Firebase一起工作,但是在firebase控制台的函数日志中,我得到了以下错误:
TypeError: readFile$(...).mergeMap is not a function
at /user_code/node_modules/angular-universal-express-firebase/node_modules/angular-universal-express/index.js:36:14
at Layer.handle [as handle_request] (/user_c
在切换到用于Angular2包管理的jspm (而不是使用脚本标记)之后,我有一些不能加载的包。它似乎是在根目录: jspm中查找它们,而不是在config.js中指定的位置。
Failed to load resource: the server responded with a status of 404 (Not Found)
Error: XHR error (404 Not Found) loading http://localhost:55707/zone.js(…)
http://localhost:55707/reflect-metadata.js Failed to load
我有一个不久前构建的npm命令行应用程序,它运行得很好。既然我已经更新了它,并且由于这段时间内类型记录的版本发生了变化,当我想运行这个包时,我会收到一个错误,它说:
Debug Failure. False expression: Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a
我将TypeScript转换为ES2015 (因为我需要异步,等待),然后将ES2015转换为Node4支持的ES2015 (Node4与ES2015不完全兼容)。
问题是express的TypeScript定义不包含default字段。但是这个字段实际上存在于Javascript代码中。(实际上express只是一个例子,例如在许多其他库bluebird中都存在问题)
因此,如果我导入import {default as express} from "express";,则会出现编译TypeScript错误。如果作为import * as express from "
我正在尝试将Firebase实时数据库实现为一个有角度的项目,并且我被困在第一步之一。导入AngularFireModule和AngularFireDatabaseModule。它给出了以下错误:
Module '"@angular/fire"' has no exported member 'AngularFireModule'.ts(2305)
Module '"@angular/fire/database"' has no exported member 'AngularFireDatabaseMod
我没有接触到任何与火基相关的文件,我似乎也不知道这到底是为什么才刚刚开始发生,但我一直得到:
We were unable to load your functions code. (see above)
- It appears your code is written in Typescript, which must be compiled before emulation.
- You may be able to run "npm run build" in your functions directory to resolve this.
我的fireb
我试图让我的Firebase数据库连接到我的角2应用程序,这是我在过去做了几次,没有任何问题。因为某种原因,我得到了这个错误
Error: Can't resolve all parameters for AppService: (?).
at Error (native)
at syntaxError (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:1513:34)
at CompileMetadataResolver._getD
我在一个React web应用程序中使用Firebase,我需要使用firebase.firestore.FieldValue.serverTimestamp()和其他一些方法。 但是,为了获得firebase引用,我导入了import * as firebase from "firebase"; 执行此导入操作会给出以下控制台警告: It looks like you're using the development build of the Firebase JS SDK.
When deploying Firebase apps to production, i
我正在尝试使用react和firebase为后端创建一个注册页面,这是控制台中的错误。
When deploying Firebase apps to production, it is advisable to only import
the individual SDK components you intend to use.
For the module builds, these are available in the following manner
(replace <PACKAGE> with the name of a component - i.e. aut
我有一个错误,上面写着Can't import 'UseSelector' from react-redux。我正在做的是一个名为“入门”的小项目--我正在使用firebase并对此做出反应,下面是出现错误的代码文件
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorker from './s