相关疑难解决方法(0)

使用Node.JS的iOS Firebase Flashlight/ElasticSearch Heroku设置

我正在使用Firebase后端在Swift中构建一个iOS应用程序.我的应用需要高级搜索选项.我被告知我应该通过这个github链接使用Flashlight/ElasticSearch https://github.com/firebase/flashlight

假设我的应用程序名称是SneakerSearch和我的

Firebase Project_ID is- sneakersearch-az12 
Firebase Web_API_Key is- abc123XYZ000...
Firebase App_Url is- gs://sneakersearch-az12.appspot.com
Run Code Online (Sandbox Code Playgroud)

由于我是Heroku和Node.js的新用户,因此我需要一些建议.我以前从未学过,但我已经安装了Heroku工具带,'sudo gem heroku install'已经完成.

我列出了github方向/步骤以及我为每个方向采取的步骤.我需要方向帮助:1,4,5,6,9,10,12和15.

1.Install and run ElasticSearch or add Bonsai service via Heroku
Run Code Online (Sandbox Code Playgroud)

我在Heroku开了帐户.

1.问题:我是否需要创建我的应用程序的名称并在设置我的Heroku帐户后进行部署,还是应该等到第9步?

2.git clone https://github.com/firebase/flashlight
Run Code Online (Sandbox Code Playgroud)

2.我将上面的内容克隆到我的iOS应用程序的项目文件夹中

3.npm install
Run Code Online (Sandbox Code Playgroud)

3.在提示我首先运行"npm init"然后我运行"npm install"

4. edit config.js (see comments at the top, you must set FB_URL and FB_SERVICEACCOUNT at a minimum)
Run Code Online (Sandbox Code Playgroud)

4A.-问题:什么是"FB_SERVICEACCOUNT"?我正在使用Firebase 3,我在控制台的服务帐户上找不到任何内容.除了我已经制作的Firebase swift项目之外,我还必须使用node.js为我的项目设置另一个Firebase帐户吗?

4B.-问题:我在哪里"编辑config.js"并将我的FB_URL和FB_SERVICEACCOUNT设置为?这应该在我的package.json文件中吗?

5.node app.js (run the app)
Run Code Online (Sandbox Code Playgroud)

5.-问题:在终端我运行"node app.js"并得到"throw err; ^".为什么我会收到此错误?

6.curl -X POST http://localhost:9200/firebase
Run Code Online (Sandbox Code Playgroud)

6.-问题:这是为了什么?

7.cd flashlight
Run Code Online (Sandbox Code Playgroud)

7.switched到手电筒目录

8.heroku …
Run Code Online (Sandbox Code Playgroud)

heroku node.js flashlight firebase bonsai-elasticsearch

9
推荐指数
1
解决办法
1341
查看次数

升级到 v14 时 Discord.js v13 代码中断

我刚刚将 Discord.js 从 v13 更新到 v14,但有很多错误。

message和事件的错误interaction

message事件也都没有发生interaction

意图错误:

const client = new Client({
  intents: [
    Intents.FLAGS.GUILDS,
    Intents.FLAGS.GUILD_MESSAGES,
    Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
  ],
});
//     Intents.FLAGS.GUILDS,
//            ^
//
// TypeError: Cannot read properties of undefined (reading 'FLAGS')

const client = new Client({
  intents: ['GUILDS', 'GUILD_MEMBERS', 'GUILD_MESSAGES'],
});
//    throw new RangeError(ErrorCodes.BitFieldInvalid, bit);
//
// RangeError [BitFieldInvalid]: Invalid bitfield flag or number: GUILDS.
Run Code Online (Sandbox Code Playgroud)

s的错误interaction

if (interaction.isCommand()) {}
// TypeError: interaction.isCommand is not a function

if …
Run Code Online (Sandbox Code Playgroud)

javascript node.js discord discord.js

8
推荐指数
1
解决办法
2万
查看次数

SyntaxError:elasticdump中的意外标记{at exports.runInThisContext(vm.js:53:16)

我试图使用elasticdump将elasticsearch数据从一个服务器移动到另一个服务器.当我给予

elasticdump --input=http://192.168.0.122:9200/my_index --output=http://localhost:9200/my_index --type=mapping
Run Code Online (Sandbox Code Playgroud)

/usr/local/lib/node_modules/elasticdump/lib/transports/elasticsearch.js:668 var {awsChain,awsAccessKeyId,awsIniFileProfile} = self.parent.options ^

SyntaxError:位于Object.Module._extensions..js(module.js:417:10)的Module._compile(module.js:374:25)处的exports.runInThisContext(vm.js:53:16)处的意外的令牌{ Module.load(module.js:344:32)在Function.Module._load(module.js:301:12)的Module.require(module.js:354:17)at require(internal/module.js:12) :17)at new elasticdump(/usr/local/lib/node_modules/elasticdump/elasticdump.js:43在对象.(在/ usr /本地/ LIB/node_modules/elasticdump/bin中/ elasticdump:96:16)

我该如何解决这个错误?

node.js elasticsearch

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

在ubuntu上安装Yeoman时出错

当我尝试在ubuntu上安装Yeoman时,我收到以下错误.

在此输入图像描述

harsha@harshamv:~$ sudo npm install yo -g
[sudo] password for harsha: 
npm http GET https://registry.npmjs.org/yo
npm http 304 https://registry.npmjs.org/yo
npm http GET https://registry.npmjs.org/nopt
npm http GET https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/update-notifier
npm http GET https://registry.npmjs.org/insight
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/sudo-block
npm http GET https://registry.npmjs.org/open/0.0.4
npm http GET https://registry.npmjs.org/chalk
npm http GET https://registry.npmjs.org/findup
npm http GET https://registry.npmjs.org/shelljs
npm http GET https://registry.npmjs.org/yeoman-generator
npm http 304 https://registry.npmjs.org/nopt
npm http 304 https://registry.npmjs.org/update-notifier
npm http 304 https://registry.npmjs.org/insight
npm http 304 https://registry.npmjs.org/lodash
npm …
Run Code Online (Sandbox Code Playgroud)

ubuntu npm yeoman

4
推荐指数
1
解决办法
4560
查看次数

类型{的参数:static:boolean; }无法分配给类型{read ?: any}的参数

在我新创建的Angular应用中,我试图使用mattlewis92的angular-calendar来创建他的日历。我已经复制了他的github上列出的所有步骤和代码:https : //mattlewis92.github.io/angular-calendar/#/kitchen-sink,但是我在第一行上一直遇到错误,@ViewChild('modalContent', { static: true }) modalContent: TemplateRef<any>;也就是说“类型{的参数:静态:布尔值;}无法分配给类型{的参数?这是其余的代码供参考,但我认为这并不重要:

import { Component, ChangeDetectionStrategy, ViewChild, TemplateRef} from '@angular/core';
import { startOfDay, endOfDay, subDays, addDays, endOfMonth, isSameDay, isSameMonth, addHours } from 'date-fns';
import { Subject } from 'rxjs';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { CalendarEvent, CalendarEventAction, CalendarEventTimesChangedEvent, CalendarView } from 'angular-calendar';

import * as _moment from 'moment';
import { JQ_TOKEN } from '../common/jQuery.service';
const moment = _moment;

const colors: any = {
  red: {
    primary: '#ad2121', …
Run Code Online (Sandbox Code Playgroud)

angular angular-calendar

3
推荐指数
2
解决办法
7271
查看次数

如何在 macOS Mojave 中将 node 升级到特定版本,并更新 node 的活动路径?

我想将 node 升级到 12.10.0 并将 npm 升级到 6.11.3,目前我正在使用 macOS Mojave 版本 10.14.5

我正在使用这些命令将节点版本升级到 12.10.0::

  1. sudo npm cache clean -f (强制)清除你的 npm 缓存
  2. sudo npm install -g n 安装 n(这可能需要一段时间)
  3. sudo n 12.10.0 升级到特定版本

运行最后一个命令后,它给了我一个输出:

installing : node-v12.10.0
       mkdir : /usr/local/n/versions/node/12.10.0
       fetch : https://nodejs.org/dist/v12.10.0/node-v12.10.0-darwin-x64.tar.gz
   installed : v12.10.0 to /usr/local/bin/node
      active : v10.16.3 at /usr/local/opt/node@10/bin/node
Run Code Online (Sandbox Code Playgroud)

当我检查节点版本时,node -v它仍然显示旧版本10.16.3

我试图添加节点路径,但它仍然给我相同的输出。我已经使用了命令sudo nano /etc/path,然后添加/usr/local/bin/node了它的路径。

请建议我如何将 node 升级到 12.10.0 并将 npm 升级到 6.11.3 版本?

macos upgrade node.js

3
推荐指数
2
解决办法
6602
查看次数

Laravel 8 安装 - npm run dev 错误

[webpack-cli] Error: mix.react() is now a feature flag. Use mix.js(source, destination).react() instead
   at React.register (F:\Server\work\reactlaravel\lrpc1\node_modules\laravel-mix\src\components\React.js:15:19)
   at Object.components.<computed> [as react] (F:\Server\work\reactlaravel\lrpc1\node_modules\laravel-mix\src\components\ComponentRegistrar.js:118:53)
   at Object.<anonymous> (F:\Server\work\reactlaravel\lrpc1\webpack.mix.js:14:5)
   at Module._compile (F:\Server\work\reactlaravel\lrpc1\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
   at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
   at Module.load (internal/modules/cjs/loader.js:985:32)
   at Function.Module._load (internal/modules/cjs/loader.js:878:14)
   at Module.require (internal/modules/cjs/loader.js:1025:19)
   at require (F:\Server\work\reactlaravel\lrpc1\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
   at module.exports (F:\Server\work\reactlaravel\lrpc1\node_modules\laravel-mix\setup\webpack.config.js:3:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ development: `mix`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem …
Run Code Online (Sandbox Code Playgroud)

npm laravel

3
推荐指数
1
解决办法
9705
查看次数